diff --git a/pkg/analyzer/lib/dart/element/element2.dart b/pkg/analyzer/lib/dart/element/element2.dart index 3aeb53b0c44b..41398c122a61 100644 --- a/pkg/analyzer/lib/dart/element/element2.dart +++ b/pkg/analyzer/lib/dart/element/element2.dart @@ -1816,9 +1816,6 @@ abstract class LocalVariableFragment @override LocalVariableElement2 get element; - @override - ExecutableFragment? get enclosingFragment; - /// Whether the variable has an initializer at declaration. bool get hasInitializer; diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart index 2877ebd4a7c2..50cdfe963aee 100644 --- a/pkg/analyzer/lib/src/dart/element/element.dart +++ b/pkg/analyzer/lib/src/dart/element/element.dart @@ -7322,8 +7322,7 @@ class LocalVariableElementImpl extends NonParameterVariableElementImpl LocalVariableElement2 get element => _element2; @override - ExecutableFragment get enclosingFragment => - enclosingElement3 as ExecutableFragment; + Fragment get enclosingFragment => enclosingElement3 as Fragment; @override String get identifier {