@@ -119,8 +119,8 @@ class _Visitor extends SimpleAstVisitor<void> {
119
119
])
120
120
.whereNotNull ()
121
121
.map ((e) => e.thisOrAncestorMatching ((a) =>
122
- a.enclosingElement2 == null ||
123
- a.enclosingElement2 is CompilationUnitElement ))
122
+ a.enclosingElement3 == null ||
123
+ a.enclosingElement3 is CompilationUnitElement ))
124
124
.map ((e) => declarationByElement[e])
125
125
.whereNotNull ()
126
126
.where ((e) => e != declaration)
@@ -152,12 +152,12 @@ class _Visitor extends SimpleAstVisitor<void> {
152
152
153
153
for (var member in unusedMembers) {
154
154
if (member is NamedCompilationUnitMember ) {
155
- rule.reportLint (member.name );
155
+ rule.reportLintForToken (member.name2 );
156
156
} else if (member is VariableDeclaration ) {
157
- rule.reportLint (member.name );
157
+ rule.reportLintForToken (member.name2 );
158
158
} else if (member is ExtensionDeclaration ) {
159
159
rule.reportLintForToken (
160
- member.name ? .token ?? member.firstTokenAfterCommentAndMetadata);
160
+ member.name2 ?? member.firstTokenAfterCommentAndMetadata);
161
161
} else {
162
162
rule.reportLintForToken (member.firstTokenAfterCommentAndMetadata);
163
163
}
@@ -166,7 +166,7 @@ class _Visitor extends SimpleAstVisitor<void> {
166
166
167
167
bool _isEntryPoint (Declaration e) =>
168
168
e is FunctionDeclaration &&
169
- (e.name.name == 'main' || e.metadata.any (_isPragmaVmEntry));
169
+ (e.name2.lexeme == 'main' || e.metadata.any (_isPragmaVmEntry));
170
170
171
171
bool _isPragmaVmEntry (Annotation annotation) {
172
172
if (! annotation.isPragma) return false ;
@@ -195,6 +195,6 @@ extension on Annotation {
195
195
// Dunno what this is.
196
196
return false ;
197
197
}
198
- return type.element ? .isPragma ?? false ;
198
+ return type is InterfaceType && type.element2 .isPragma;
199
199
}
200
200
}
0 commit comments