Skip to content

Commit

Permalink
[element model] migrate unreachable_from_main
Browse files Browse the repository at this point in the history
Bug: dart-lang/linter#5099
Change-Id: I31ee1aff4cbca63b8b66d6fe31a6e901d104fa71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394005
Reviewed-by: Konstantin Shcheglov <[email protected]>
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Phil Quitslund <[email protected]>
  • Loading branch information
pq authored and Commit Queue committed Nov 8, 2024
1 parent 7b8de02 commit 25f8cc5
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 68 deletions.
2 changes: 2 additions & 0 deletions pkg/analyzer/lib/src/dart/ast/ast.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8076,6 +8076,8 @@ final class ForStatementImpl extends StatementImpl
/// A declaration of a fragment of an element.
@experimental
abstract final class FragmentDeclaration implements Declaration {
// TODO(pq): move `declaredFragment` into `Declaration` and remove this class.

/// The fragment declared by this declaration.
///
/// Returns `null` if the AST structure hasn't been resolved.
Expand Down
9 changes: 9 additions & 0 deletions pkg/analyzer/lib/src/dart/element/element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1970,6 +1970,9 @@ class DynamicElementImpl2 extends TypeDefiningElementImpl2 {
@override
Null get documentationComment => null;

@override
Element2? get enclosingElement2 => null;

@override
DynamicElementImpl get firstFragment => DynamicElementImpl.instance;

Expand Down Expand Up @@ -8431,6 +8434,9 @@ class NeverElementImpl extends ElementImpl
@override
NeverElementImpl2 get element => NeverElementImpl2.instance;

@override
Element2? get enclosingElement2 => null;

@override
Null get enclosingFragment => null;

Expand Down Expand Up @@ -8480,6 +8486,9 @@ class NeverElementImpl2 extends TypeDefiningElementImpl2 {
@override
Null get documentationComment => null;

@override
Element2? get enclosingElement2 => null;

@override
NeverElementImpl get firstFragment => NeverElementImpl.instance;

Expand Down
4 changes: 1 addition & 3 deletions pkg/analyzer/lib/src/dart/element/inheritance_manager3.dart
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,7 @@ class InheritanceManager3 {
if (elements == null) {
return null;
}
return elements
.map((fragment) => (fragment as ExecutableFragment).element)
.toList();
return elements.map((fragment) => fragment.asExecutableElement2).toList();
}

/// Return all members of mixins, superclasses, and interfaces that a member
Expand Down
Loading

0 comments on commit 25f8cc5

Please sign in to comment.