22// for details. All rights reserved. Use of this source code is governed by a
33// BSD-style license that can be found in the LICENSE file.
44
5- // ignore_for_file: analyzer_use_new_elements
6-
75import 'package:analyzer/src/dart/ast/ast.dart' ;
86import 'package:analyzer/src/dart/ast/extensions.dart' ;
97import 'package:analyzer/src/dart/element/element.dart' ;
@@ -18,13 +16,13 @@ class TypeAliasSelfReferenceFinder {
1816 if (node is FunctionTypeAliasImpl ) {
1917 var finder = _Finder (linker, node);
2018 finder.functionTypeAlias (node);
21- var element = node.declaredElement as TypeAliasElementImpl ;
22- element .hasSelfReference = finder.hasSelfReference;
19+ var fragment = node.declaredFragment as TypeAliasElementImpl ;
20+ fragment .hasSelfReference = finder.hasSelfReference;
2321 } else if (node is GenericTypeAliasImpl ) {
2422 var finder = _Finder (linker, node);
2523 finder.genericTypeAlias (node);
26- var element = node.declaredElement as TypeAliasElementImpl ;
27- element .hasSelfReference = finder.hasSelfReference;
24+ var fragment = node.declaredFragment as TypeAliasElementImpl ;
25+ fragment .hasSelfReference = finder.hasSelfReference;
2826 }
2927 }
3028 }
@@ -89,12 +87,12 @@ class _Finder {
8987 if (node == null ) return ;
9088
9189 if (node is NamedType ) {
92- var element = node.element ;
93- if (element is ! ElementImpl ) {
90+ var element = node.element2 ;
91+ if (element is ! ElementImpl2 ) {
9492 return ;
9593 }
9694
97- var typeNode = linker.getLinkingNode (element);
95+ var typeNode = linker.getLinkingNode2 (element);
9896 if (typeNode != null ) {
9997 if (typeNode == self) {
10098 hasSelfReference = true ;
0 commit comments