diff --git a/pkg/analyzer/lib/src/generated/error_verifier.dart b/pkg/analyzer/lib/src/generated/error_verifier.dart index c517a7d0e053..9cde77cb522b 100644 --- a/pkg/analyzer/lib/src/generated/error_verifier.dart +++ b/pkg/analyzer/lib/src/generated/error_verifier.dart @@ -833,7 +833,7 @@ class ErrorVerifier extends RecursiveAstVisitor var members = node.members; _checkForRepeatedType( - libraryContext.setOfImplements(firstFragment), + libraryContext.setOfImplements(firstFragment.asElement2), node.implementsClause?.interfaces, CompileTimeErrorCode.IMPLEMENTS_REPEATED, ); @@ -1908,7 +1908,7 @@ class ErrorVerifier extends RecursiveAstVisitor !_checkForNoGenerativeConstructorsInSuperclass(superclass)) { _checkForExtendsDeferredClass(superclass); _checkForRepeatedType( - libraryContext.setOfImplements(declarationElement), + libraryContext.setOfImplements(declarationElement.asElement2), implementsClause?.interfaces, CompileTimeErrorCode.IMPLEMENTS_REPEATED, ); @@ -2115,7 +2115,7 @@ class ErrorVerifier extends RecursiveAstVisitor // check exported names Namespace namespace = NamespaceBuilder().createExportNamespaceForDirective(exportElement); - Map definedNames = namespace.definedNames; + Map definedNames = namespace.definedNames2; for (String name in definedNames.keys) { var element = definedNames[name]!; var prevElement = libraryContext._exportedElements[name]; @@ -2125,8 +2125,8 @@ class ErrorVerifier extends RecursiveAstVisitor CompileTimeErrorCode.AMBIGUOUS_EXPORT, arguments: [ name, - prevElement.library!.definingCompilationUnit.source.uri, - element.library!.definingCompilationUnit.source.uri + prevElement.library2!.firstFragment.source.uri, + element.library2!.firstFragment.source.uri ], ); return; @@ -5206,7 +5206,7 @@ class ErrorVerifier extends RecursiveAstVisitor } void _checkForRepeatedType( - Set accumulatedElements, + Set accumulatedElements, List? namedTypes, ErrorCode errorCode, ) { @@ -5217,13 +5217,13 @@ class ErrorVerifier extends RecursiveAstVisitor for (var namedType in namedTypes) { var type = namedType.type; if (type is InterfaceType) { - var element = type.element; + var element = type.element3; var added = accumulatedElements.add(element); if (!added) { errorReporter.atNode( namedType, errorCode, - arguments: [element.name], + arguments: [element.name3!], ); } } @@ -6144,12 +6144,12 @@ class ErrorVerifier extends RecursiveAstVisitor !_checkForImplementsClauseErrorCodes(implementsClause)) { // _checkForImplicitDynamicType(superclass); _checkForRepeatedType( - libraryContext.setOfOn(declarationElement), + libraryContext.setOfOn(declarationElement.asElement2), onClause?.superclassConstraints, CompileTimeErrorCode.ON_REPEATED, ); _checkForRepeatedType( - libraryContext.setOfImplements(declarationElement), + libraryContext.setOfImplements(declarationElement.asElement2), implementsClause?.interfaces, CompileTimeErrorCode.IMPLEMENTS_REPEATED, ); @@ -6663,16 +6663,17 @@ class LibraryVerificationContext { final Map files; /// A table mapping names to the exported elements. - final Map _exportedElements = {}; + final Map _exportedElements = {}; /// Elements referenced in `implements` clauses. /// Key: the declaration element. - final Map> _setOfImplementsMap = + final Map> _setOfImplementsMap = Map.identity(); /// Elements referenced in `on` clauses. /// Key: the declaration element. - final Map> _setOfOnMaps = Map.identity(); + final Map> _setOfOnMaps = + Map.identity(); LibraryVerificationContext({ required this.libraryKind, @@ -6684,11 +6685,11 @@ class LibraryVerificationContext { return libraryKind.libraryCycle.libraryUris.contains(uri); } - Set setOfImplements(InstanceElement declaration) { + Set setOfImplements(InstanceElement2 declaration) { return _setOfImplementsMap[declaration] ??= Set.identity(); } - Set setOfOn(MixinElement declaration) { + Set setOfOn(MixinElement2 declaration) { return _setOfOnMaps[declaration] ??= Set.identity(); } }