NormalFormalParameter now implements AnnotatedNode.Element.enclosingElement, use enclosingElement3.AnalysisContextCollection.dispose(). It must be invoked at the end.ContextLocator and ContextBuilder. Use AnalysisContextCollection instead.File.createSource(), it violates levels of abstraction. You can get Source instances from AnalysisResults.AnalysisError.src/file_system/file_system.dart from file_system/file_system.dart.package:analyzer/src/source/source_resource.dart, import package:analyzer/source/file_source.dart instead.package:analyzer/src/source/source.dart, import package:analyzer/source/source.dart instead.macros: '>=0.1.2-0 <0.1.3'.macros: '>=0.1.1-0 <0.1.2'.LibraryElement.toLegacyTypeIfOptOut.LibraryElement.toLegacyElementIfOptOut.LibraryElement.isNonNullableByDefault.InterfaceElement.lookUpGetter, InterfaceElement.lookUpMethod, and InterfaceElement.lookUpSetter.GeneralizingAstVisitor.visitNamedType to invoke visitTypeAnnotation.PropertyInducingElement get variable in PropertyAccessorElement, use PropertyInducingElement? get variable2 instead. The reason for this is that when the property accessor is an augmentation without the corresponding declaration, there is no corresponding variable.ExtensionDeclaration.onKeyword and extendedType. Use ExtensionOnClause? get onClause instead. Extension augmentations are not allowed to have onClause.OnClause, use MixinOnClause instead.@doNotSubmit.@mustBeConst.constructor, directive, enumValue, and typeParameter.AstNode.getProperty and AstNode.setProperty. Clients who need the ability to add arbitrary decorations to AST nodes can achieve the same effect using Dart's built-in Expando class.3.3.ConstantEvaluator.InstanceElement, a super-interface for InterfaceElement and ExtensionElement.TypeSystem.greatestLowerBound.declaredElement2 from AST.element2 from AST.name2 from AST.FunctionBody.isPotentiallyMutatedInClosure.extensionName, staticElement from ExtensionOverride.name from NamedType.>=3.0.0 <4.0.0.abstract final or sealed.InvalidType is now used when types or property cannot be resolved. Previously DynamicType was used.DartType.isDynamic, use is DynamicType instead.NamedType to use importPrefix and name2 token. The deprecated name node is still visited in this version, but will stop in the next major version.ExtensionOverride to use importPrefix and name token. The deprecated extensionName node is still visited in this version, but will stop in the next major version.AnalysisError constructor, use tmp constructor, with names formal parameters. Theoretically no clients should use either, but practically there are two uses currently.InvalidType, used when a named type cannot be resolved, or a property cannot be resolved, etc. Previously DynamicType was used. In the future DynamicType will be used only when specified explicitly, or a property is resolved against a dynamic target. The clients should prepare by checking also for InvalidType in addition to DynamicType.finalKeyword, interfaceKeyword and sealedKeyword of MixinElement. We added them preliminary while working on the class modifiers feature, but eventually decided to remove. See https://github.com/dart-lang/sdk/issues/52159 for details.@experimental from AST nodes and elements for records and patterns.IfStatement.condition, use expression instead.NamedType.importPrefix, NamedType.name2, and NamedType.element. Deprecated NamedType.name. Currently Identifier is an expression, and an expression as a name of a type does not make sense. So, instead we model it as a name token, the Element that it references, and an optional import library prefix reference.DartType.isDartCoreType.FunctionBody.isPotentiallyMutatedInClosure, not used by clients.FunctionBody.isPotentiallyMutatedInScope and pattern assignment.DartType.isVoid, use is VoidType instead.records, patterns, and class-modifiers features enabled by default.>=2.19.0 <3.0.0 to use PathNotFoundException from dart:io.class-modifiers feature.patterns feature.DartPattern.precedence.RecordPatternField to PatternField.RecordPatternFieldName to PatternFieldName.collection: ^1.17.0 because we use elementAtOrNull.3.0.0 as the current language version.Element.enclosingElement3, use enclosingElement instead.Directive.element2, use element instead.CatchClause.exceptionParameter2, use exceptionParameter instead.CatchClause.stackTraceParameter2, use stackTraceParameter instead.DartType.element2, use element instead.Element.isAccessibleIn2(), use isAccessibleIn() instead.CompilationUnitElement.enums2, use enums instead.CompilationUnitElement.getEnum2(), use getEnum() instead.CompilationUnitElement.mixins2, use mixins instead.LibraryElement.parts2, use parts instead.ImportElement.imports2, use imports instead.AnalysisDriverForPackageBuild.sdkLibraryUris.buildSdkSummary2(), use buildSdkSummary() instead.AstNode.name2, use name instead.AstNode.declaredElement2, use declaredElement instead.DiagnosticMessage.message.LibraryElement.getImportsWithPrefix().ParameterElement.isNotOptional.DartType.displayName.AnalysisDriver.ClassOrMixinDeclaration.Declaration.declaredElement.Element.enclosingElement and enclosingElement2.ExportElement, ImportElement.NamedCompilationUnitMember.name.Declaration.declaredElement.DartType.element.addXyz to NodeLintRegistry.lookUpInheritedConcreteX() to InterfaceElement.DartType.element2, so that InterfaceType.element2 overrides it.FormalParameter.identifier.ClassOrMixinDeclaration, use ClassDeclaration and MixinDeclaration directly.Declaration.declaredElement, use declaredElement2 instead. This is necessary to separate ClassElement, EnumElement, and MixinElement. And, in the future, augmentations like ClassAugmentationElement, etc.TypeSystem.instantiateToBounds2(), use instantiateInterfaceToBounds() or instantiateTypeAliasToBounds() instead.ClassDeclaration.isAbstract, use abstractKeyword instead.ClassTypeAlias.isAbstract, use abstractKeyword instead.ClassOrMixinDeclaration.getField, filter members instead.ClassOrMixinDeclaration.getMethod, filter members instead.ClassDeclaration.getConstructor, filter members instead.Directive.element, use element2 instead.ClassElement.hasStaticMember, it is not useful for clients.NamespaceDirective.uriElement, use element2.uri with DirectiveUriWithLibrary instead.UriBasedDirective.uriContent, UriBasedDirective.uriElement, UriBasedDirective.uriSource. Use Directive.element2.uri instead.NamespaceDirective.selectedSource, use element2.uri with DirectiveUriWithSource instead.Configuration.uriSource, use resolvedUri instead.CatchClause.exceptionParameter and CatchClause.stackTraceParameter. Use exceptionParameter2 and stackTraceParameter2 instead.FileResult.isAugmentation and isLibrary to complement isPart.name2 and declaredElement instead.Element.enclosingElement2, use enclosingElement3 instead. The meaningful change is that ConstructorElement.enclosingElement3 returns now InterfaceElement, not ClassElement.get enums/mixin, use get enums2/mixins2 instead.DartType.element, check for InterfaceType, TypeParameterType, and then ask the element.ClassElement.isEnum and isMixin. Check for is EnumElement and is MixinElement instead.LibraryElement.getType() use getClass() instead.identifier for LibraryExportElement and LibraryImportElement.Directive.keyword, use corresponding xyzToken in specific directives.LibraryElement.parts, use parts2 instead.LibraryElement.exports, use libraryExports instead.LibraryElement.imports, use libraryImports instead.Element.enclosingElement, use enclosingElement2 instead.Member is not equal to ElementImpl, use Element.declaration.>=2.17.0 <3.0.0.ImportDirective.COMPARATOR, use appropriate custom logic, if necessary.Element.isAccessibleIn(), use isAccessibleIn2() instead.ParameterElement.isNotOptional, use isRequired instead.ResourceProviderMixin.newFile2, use newFile instead.ResourceProviderMixin.newAnalysisOptionsYamlFile2, use newAnalysisOptionsYamlFile instead.DartType.resolveToBound, use TypeSystem.resolveToBound instead.LibraryElement.getImportsWithPrefix, use PrefixElement.imports instead.AnalysisSession.getFile() to return updated content after applyPendingFileChanges.UriKind and Source.uriKind.LibraryElement.hasExtUri.LibraryElement.hasLoadLibraryFunction.ImportElement.prefixOffset.CompilationUnitElement.types.Source.encoding.Source.isInSystemLibrary.Source.modificationStamp.stamp in MemoryResourceProvider.SourceFactory.restoreUri, use pathToUri instead.AnalysisContext.workspace.isNonNullableByDefault parameter in ErrorReporter is now required.Element.SORT_BY_OFFSET, it is not used.AnalysisSession.getFile and getParsedUnit to fail if there are pending file changes, instead of reading. As for any other AnalysisSession method, await AnalysisContext.applyPendingFileChanges().Token.copy() and copyComments().CommentToken.remove().astFactory and AstFactory.AnalysisOptions.signature and signaturesEqual.buildSdkSummary().AnalysisSession.Resource.parent2, use parent instead.astFactory, clients should not create AST nodes manually.CompilationUnit.lineInfo to be non-nullable.CompilationUnitElement.lineInfo to be non-nullable.ResourceProviderMixin.newFile, use newFile2 instead.ResourceProviderMixin.newAnalysisOptionsYamlFile.AnalysisContext.changeFile and AnalysisContext.applyPendingFileChanges.buildSdkSummary, use asynchronous buildSdkSummary2 instead.getField to ExtensionElement.isGenerative to ConstructorElement.isDartCoreEnum to ClassElement and DartType.superclass2, mixinTypes2, etc. Use superclass, mixinTypes, etc.enhanced-enums language feature.changes getter in File and Folder, use watch() instead.package:dart_style.MockSdk class.AnalysisDriver constructor.2.17.DartType.aliasElement/aliasArguments.FeatureSet.UnitElementResult.signature - unused by clients.AnalysisError.withNamedArguments.ErrorReporter.reportErrorMessage.ResourceProvider.getModificationTimes().MemoryResourceProvider.newDummyLink().MemoryResourceProvider.updateFile().Resource.parent.ResultState and AnalysisResult.state.summary_file_builder library.message and correction from ErrorCode.lookUp methods from InterfaceType.InterfaceType.getSmartLeastUpperBound.path and uri from AnalysisResult.AnalysisSession.TypeName and corresponding methods.TypeProvider.getXyz methods in AnalysisDriver.double in mock SDK.path and uri from AnalysisResult.UriResolver.restoreAbsolute, use pathToUri instead.SourceFactory.restoreAbsolute, use pathToUri instead.UriKind and Source.uriKind.Source.modificationStamp.Source.isInSystemLibrary, use uri.isScheme('dart') instead.ConstructorElement.displayName to either Class or Class.constructor.InterfaceType.getSmartLeastUpperBound, use TypeSystem.leastUpperBound instead.MockSdk, use createMockSdk and FolderBasedDartSdk instead.AnalysisResult.state, check for specific valid or invalid subtypes.ResultState.LibraryElement.hasExtUri, FFI should be used instead.MockSdk to include more declarations.ResourceProvider.getModificationTimes().MemoryResourceProvider.newDummyLink().MemoryResourceProvider.updateFile().TypeName, use NamedType instead.AstVisitor.visitNamedType() instead of visitTypeName().ClassTypeAlias.superclass, use superclass2 instead.ConstructorName.type, use type2 instead.ExtendsClause.superclass, use superclass2 instead.ImplementsClause.interfaces, use interfaces2 instead.OnClause.superclassConstraints, use superclassConstraints2 instead.TypeLiteral.typeName, use type instead.WithClause.mixinTypes, use mixinTypes2 instead.AstFactory.typeName(), use namedType() instead.constructor-tearoffs feature by default in 2.15.AnalysisResult.path to be non-nullable.ParsedLibraryResult.units to be non-nullable.ResolvedLibraryResult.element to be non-nullable.ResolvedLibraryResult.units to be non-nullable.ResolvedUnitResult.content to be non-nullable.ResolvedUnitResult.unit to be non-nullable.AnalysisSession.getXyz2() into getXyz().AnalysisDriver.results to Stream<Object>. It used to always produce ResolvedUnitResults, but sometimes its content and unit were null, when the result actually had only errors. Now it produces either ResolvedUnitResult, or ErrorsResult, or some other results that might be added in the future.DartType.alias with information about instantiated type alias. The type alias element and arguments are present or absent together.DartType.aliasElement and DartType.aliasArguments.2.15.Scope.lookup2().FunctionTypeAliasElement.LineInfo.getLocation() to return CharacterLocation.LineInfo_Location.AnalysisSession.DartObject.type from ParameterizedType? to DartType?.FunctionType to implement DartType, not ParameterizedType.FunctionType.element and FunctionType.typeArguments.DartObject.type from ParameterizedType? to DartType?.FunctionType to implement DartType, not ParameterizedType.FunctionType.element and FunctionType.typeArguments.StringInterpolation.firstString and lastString, to express explicitly that there are always (possibly empty) strings as the first and the last elements of an interpolation.ImportElement.prefixOffset, use prefix.nameOffset instead.CompilationUnitElement.types, use classes instead.Element.nonSynthetic, use it to get the element that caused creation of this element, e.g. the field for a synthetic getter.FieldElement.isFinal is true only when the field is not synthetic.-1 as nameOffset.defaultValueCode is null for field formal parameters.LibraryElement.name so that it is non-nullable.meta: ^1.4.0.AnalysisDriver default constructor. Added tmp1. The goal is to allow deprecating and removing unused parameters.ConstructorReference, FunctionReference, and TypeLiteral.2.14.AnalysisSession.getUnitElement(). Use AnalysisSession.getUnitElement2() instead.AnalysisSession.getResolvedUnit(). Use AnalysisSession.getResolvedUnit2() instead.AnalysisSession.getResolvedLibrary(). Use AnalysisSession.getResolvedLibrary2() instead.AnalysisSession.getResolvedLibraryByElement(). Use AnalysisSession.getResolvedLibraryByElement2() instead.AnalysisSession.getLibraryByUri(). Use AnalysisSession.getLibraryByUri2() instead.AnalysisSession.getErrors(). Use AnalysisSession.getErrors2() instead.AnalysisSession.getParsedLibrary(). Use AnalysisSession.getParsedLibrary2() instead.AnalysisSession.getParsedLibraryByElement(). Use AnalysisSession.getParsedLibraryByElement2() instead.AnalysisSession.getParsedUnit(). Use AnalysisSession.getParsedUnit2() instead.AnalysisSession.getFile() and getSourceKind(). Use AnalysisSession.getFile2() instead.AnalysisSession.getUnitElementSignature(). This method is not used by any known client, and will be removed.TypeProvider.nonSubtypableClasses. Use TypeProvider.isNonSubtypableClass instead.sdkPath to AnalysisContextCollection constructor.nonfunction-type-aliases is enabled by default in the language version 2.13.Expression.inConstantContext to API.null.CompilationUnitElement.mixins before types.parseString() instead.AnalysisSession.getErrors() does not return null, check its state.aliasElement and aliasArguments for aliases of InterfaceTypes and TypeParameterTypes.TypeProvider.futureType2(), iterableType2(), etc. Use corresponding TypeProvider.futureType(), iterableType(), etc.Resource.parent2 and deprecated Resource.parent.Folder.isRoot.FolderExtension with withAncestors.ContextRoot.workspace, deprecated AnalysisContext.workspace.ElementVisitor.visitFunctionTypeAliasElement(). Override ElementVisitor.visitTypeAliasElement() instead.FunctionTypeAliasElement. Use TypeAliasElement instead.2.12.0.FunctionTypeAliasElement.function. Use TypeAliasElement.aliasedElement instead.CompilationUnitElement.functionTypeAliases. Use CompilationUnitElement.typeAliases instead.AnalysisContext.sdkRoot.NullSafetyUnderstandingFlag.functionTypeAliasElement from TypeSystem.instantiateToBounds2.Annotation.typeArguments in preparation for supporting #44838.actualUri from UriResolver.resolveAbsolute.FunctionType.element and FunctionType.typeArguments.PackageBuildWorkspace that supports package:build to stop at the first directory with pubspec.yaml, and don't try to go up and find another one with both pubspec.yaml and .dart_tool/build.ErrorCode class. It will be used to migrate existing ErrorCode subclasses, and then deprecated and removed.Scope.lookup({id, setter}) with lookup(id).Scope.lookup2(id), use lookup() instead.Member.baseElement.package:analyzer/analyzer.dart library.ElementAnnotation.constantValue.VariableElement.constantValue.VariableElement.initializer.auxiliaryElements.FunctionType.element for types created from a typedef is now FunctionTypeAliasElement, not its function element.GenericTypeAliasElement.PhysicalResourceProvider.NORMALIZE_EOL_ALWAYS.PhysicalResourceProvider constructor to no longer take a required positional parameter (removed the existing fileReadMode positional parameter).GenericTypeAliasElement. Use FunctionTypeAliasElement.AnalysisDriver. Specifically, parseFileSync will not read any referenced files.IndexExpression.auxiliaryElements and SimpleIdentifier.auxiliaryElements. Use CompoundAssignmentExpression.getReadType, use CompoundAssignmentExpression.2.11.meta: ^1.2.3.LocalVariableElement.hasInitializer, PropertyInducingElement.hasInitializer, ParameterElement.hasDefaultValue.ElementImpl.toString() uses getDisplayString(withNullability: true).ElementAnnotation.constantValue, it does not guarantee that the value has been computed. Use computeConstantValue() instead.CompoundAssignmentExpression with read/write element/type getters. This interface is implemented by AssignmentExpression, PostfixExpression and PrefixExpression. Use it instead of staticElement and staticType of the left-hand side expressions (target expressions in case of postfix or prefix expressions with increment operator).LibraryElement.featureSet.EmbedderSdk and related classes.FunctionType returned from ExecutableElement.type return null as its element. Use ExecutableElements directly if necessary.FunctionTypeAliasElement does not implement FunctionTypedElement anymore, implements TypeParameterizedElement instead.CustomUriResolver.ExplicitSourceResolver, FileUriResolver, LocalSourcePredicate, PackageUriResolver, RelativeFileUriResolver.ErrorCode instances.withNullability flag in DartType.getDisplayString() is now required.DartType.substitute2, and FunctionType.substitute3, use ClassElement.instantiate, FunctionTypeAliasElement.instantiate(), or FunctionType.instantiate().FunctionType.boundTypeParameters, use typeFormals for now. Later, it will be deprecated, and replaced with typeParameters.InterfaceType.instantiate(), InterfaceType.substitute4, use ClassElement.instantiate().typeParameters and instantiate() from ParameterizedType. Use typeParameters and instantiate() from ClassElement.DeclaredVariables.typeProvider and typeSystem getters. Use corresponding LibraryElement getters instead.AnalysisOptions.ClassElement.hasReferenceToSuper.DartType.isObject. Use DartType.isDartCoreObject instead.AnalysisContext and ContextLocator.ParseResult and ResolveResult.AnalysisContext.typeProvider and typeSystem. Use the corresponding getters of LibraryElement.AnalysisSession.dart/ast/ast.dart.AstFactory.parseFile2..TypeDefiningElement.type.Feature are not constants anymore.Feature.firstSupportedVersion with releaseVersion.TypeVisitorWithArgument and DartType.acceptWithArgument.>=2.7.0, so that extension methods can be used within the analyzer implementation. Previously it was 2.6.0, but there is an issue.asInstanceOf(ClassElement) to DartType, so that it is also supported for TypeParameterType when its bound implements the requested interface.InterfaceType.allSupertypes.currentVersion of the language updated to 2.10.defaultSdkDirectory() and getSdkProperty() from internal FolderBasedDartSdk. It is up to the clients to decide how to find SDK, for example using package:cli_util.LintDriver for the new way to access WorkspacePackage.Scope.lookup(), use Scope.lookup2() instead.ContextBuilder.createContext() and ContextLocator.locateContexts to use the current SDK if sdkPath is not provided.buildSdkSummary.DynamicType, NeverType, and VoidType interfaces.TypeVisitor and DartType.accept(TypeVisitor).ConstructorElement.returnType to InterfaceType.InterfaceType.allSupertypes.InterfaceType.asInstanceOf(ClassElement).bogus-disabled and bogus-enabled.Scope, LibraryElement.scope, and PrefixElement.scope.canUseSummaries in DartSdkManager constructor. Summaries are not supported this way for SDK.ClassElement.hasReferenceToSuper. It was used internally, should not be part of API.LibraryElement.languageVersionMajor/minor. Use LibraryElement.languageVersion to access more specific information.SummaryBuilder, and the featureSet named parameter in build, for build_resolvers compatibility. See #42163.DartType.isObject, use DartType.isDartCoreObject for consistency with other similar getters.InstanceCreationExpression.staticElement, use constructorName.staticElement instead, like for MethodInvocation.VariableElement.constantValue, it does not guarantee that the value has been computed. Use computeConstantValue() instead.AnalysisOptions: analyzeFunctionBodiesPredicate, disableCacheFlushing, enableLazyAssignmentOperators, generateImplicitErrors, generateSdkErrors, patchPaths, preserveComments, trackCacheDependencies, and resetToDefaults.ClassElement.instantiateToBounds() and FunctionTypeAliasElement.instantiateToBounds(). With the null-safety feature, type arguments derived from type parameter bounds cannot be used as is, and might require erasing nullability, when the element is instantiated from a legacy library. Use TypeSystem.instantiateToBounds2() instead.DeclaredVariables.getBool/getInt/getString() and TypeProvider.nullObject. These methods are used internally for constants computation, and should not be used by clients.AstFactory.indexExpressionForCascade(). Please use indexExpressionForCascade2 instead.AstFactory.indexExpressionForTarget(). Please use indexExpressionForTarget2 instead.ClassElement.isOrInheritsProxy and ClassElement.isProxy. The @proxy annotation is deprecated in the language, and will be removed.List constructor under all circumstances.??) and if-null compound assignment expressions (??=).DartType.name, use element or getDisplayString() instead.>=2.6.0, so that extension methods can be used within the analyzer implementation.ErrorReporter.source setter. One file - one reporter.Element.getAncestor. Use thisOrAncestorMatching or thisOrAncestorOfType instead.DartType.displayName. Use getDisplayString instead.InterfaceType: lookupGetter, lookUpGetterInSuperclass, lookUpInheritedGetter, lookUpInheritedGetterOrMethod, lookUpInheritedMethod, lookUpInheritedSetter, lookUpMethod, lookUpMethodInSuperclass, lookUpSetter, and lookUpSetterInSuperclass. Use lookUpGetter2(), lookUpMethod2(), or lookUpSetter2() instead, with concrete or inherited flags as necessary.ErrorReporter.reportTypeErrorForNode. Use reportErrorForNode instead.AnalysisSession.typeProvider and AnalysisSession.typeSystem. Please use the corresponding getters in LibraryElement instead.DartType.substitute2(). Use ClassElement.instantiate() or FunctionTypeAliasElement.instantiate() instead.ParameterizedType.instantiate() and InterfaceType.instantiate(). Use ClassElement.instantiate() instead. Using FunctionType.instantiate() is still valid.FunctionTypeAliasElement.instantiate2, use instantiate2. In the next version instantiate2 will be removed.ParameterizedType.typeParameters. Please use ClassElement.typeParameters or FunctionType.typeFormals instead.DartType.isEquivalentTo.useDart2jsPaths argument in FolderBasedDartSdk constructor. Dartium does not exist anymore, so there is just one dart:html.SourceFactory: context, localSourcePredicate, clone, fromEncoding, isLocalSource.Element.computeNode.CompilationUnitElement.unit.Element.computeDocumentationComment.wrapped.dart with WrappedLibraryElement, etc.ResolutionMap resolutionMap. Use corresponding accessors on AstNode(s) directly to get elements and types.DartType: flattenFutures, isAssignableTo, isEquivalentTo, isMoreSpecificThan, isSubtypeOf, isSupertypeOf, isDirectSupertypeOf. Use corresponding methods of TypeSystem instead.isAlwaysThrows, isDeprecated, isFactory, isJS, isOverride, isProtected, isRequired, isVisibleForTesting. Use corresponding hasXyz getters.LibraryElement.libraryCycle.ElementHandle and ElementResynthesizer.ElementBuilder, DeclarationResolver, DirectiveResolver, TypeParameterBoundsResolver, TypeResolverVisitor, etc. Use ResolutionVisitor instead, it combines all these operations.FunctionTypeAliasElement.instantiate, use instantiate2 for now. In the next version instantiate will be re-introduced with the same signature and semantics as instantiate2, and instantiate2 will be deprecated and removed in the next breaking change version.InheritanceManagerBase.ArgumentList.correspondingPropagatedParameters. Use ArgumentList.correspondingStaticParameters instead.PrefixElement.importedLibraries. It was never implemented.VariableElement.isPotentiallyMutatedInClosure and VariableElement.isPotentiallyMutatedInScope. Please use the corresponding methods in FunctionBody instead.PromotableElement, which representing variables that can be type promoted (local variables and parameters, but not fields).AnalysisDriver.useSummary2. Summary1 support has been removed, so clients should assume Summary2 is in use now.useDart2jsPaths for SdkLibrariesReader. We now always use Dart2js paths.StaticWarningCode. Please use the corresponding error codes from CompileTimeErrorCode instead:EXTRA_POSITIONAL_ARGUMENTSEXTRA_POSITIONAL_ARGUMENTS_COULD_BE_NAMEDIMPORT_OF_NON_LIBRARYNOT_ENOUGH_REQUIRED_ARGUMENTSREDIRECT_TO_MISSING_CONSTRUCTORREDIRECT_TO_NON_CLASSUNDEFINED_CLASSUNDEFINED_NAMED_PARAMETERFunctionTypeAlias.declaredElement has been refined to FunctionTypeAliasElement. Since the new type is a refinement of the old one, the only effect on clients should be to make certain casts unnecessary.HintCode.INVALID_REQUIRED_PARAM and replaced it with more specific hints, HintCode.INVALID_REQUIRED_NAMED_PARAM, HintCode.INVALID_REQUIRED_OPTIONAL_POSITIONAL_PARAM, and HintCode.INVALID_REQUIRED_POSITIONAL_PARAM to address #36966.CompileTimeErrorCode.NOT_ENOUGH_REQUIRED_ARGUMENTS. It has been renamed to CompileTimeErrorCode.NOT_ENOUGH_POSITIONAL_ARGUMENTS.AstFactory.compilationUnit2 has been removed. Clients should switch back to AstFactory.compilationUnit.ParsedLibraryResultImpl.tmp and the deprecated method ResolvedLibraryResultImpl.tmp. Please use AnalysisSession.getParsedLibraryByElement and AnalysisSession.getResolvedLibraryByElement instead.MethodElement.getReifiedType.ClassMemberElement.enclosingElement was changed from ClassElement to Element.ClassMemberElement.enclosingElement was changed from ClassElement to Element). This change will be postponed until 0.38.0.isDartCoreList, isDartCoreMap, isDartCoreNum, isDartCoreSet, isDartCoreSymbol, and isDartCoreObject to DartType.DartObject.toFunctionValue.isEquivalentTo(DartType) method of DartType. The operator == now correctly considers two types equal if and only if they represent the same type as defined by the spec.isMoreSpecificThan(DartType) method of DartType. Deprecated the isMoreSpecificThan(DartType) method of TypeSystem. Deprecated the isSupertypeOf(DartType) method of TypeSystem. Use TypeSystem.isSubtypeOf(DartType) instead.flattenFutures, isAssignableTo of DartType. Use TypeSystem.flatten() and TypeSystem.isAssignableTo instead.path to parseString.TypeSystem.resolveToBound(DartType) implementation to do what its documentation says.InterfaceType.isDirectSupertypeOf. There is no replacement; this method was not intended to be used outside of the analyzer.DartType.isUndefined.SdkLibrariesReader.InstanceCreationExpressionImpl.canBeConst.AstFactory.compilationUnit method now uses named parameters. Clients that prepared for this change by switching to AstFactory.compilationUnit2 should now switch back to AstFactory.compilationUnit.AstNode.getAncestor. Please use AstNode.thisOrAncestorMatching or AstNode.thisOrAncestorOfType.TypeSystem.isStrong, and its override Dart2TypeSystem.isStrong.AnalysisError.isStaticOnly and the deprecated setters AnalysisError.isStaticOnly and AnalysisError.offset.abstract setter in ClassElementImpl, EnumElementImpl, MethodElementImpl, and PropertyAccessorElementImpl. isAbstract should be used instead.AstVisitor.ForStatement2, ListLiteral.elements2, SetOrMapLiteral.elements2, AstFactory.forStatement2, and NodeLintRegistry.addForStatement2, as well as class ForStatement2. Use the variants without the “2” suffix instead.parseFile to match parseFile2. Clients that switched to using parseFile2 when parseFile was deprecated should now switch back to parseFile.enableControlFlowCollections, enableNonNullable, enableSpreadCollections, and enableTripleShift, and the method configureFeatures. Made the featureSet parameter of the Parser constructor a required parameter.isNonNullableUnit parameter of the TypeResolverVisitor constructor. TypeResolverVisitor should now be configured using the featureSet parameter.TypeParameter.declaredElement. It is always guaranteed to return a TypeParameterElement.abstract setter in ClassElementImpl, EnumElementImpl, MethodElementImpl, and PropertyAccessorElementImpl. isAbstract should be used instead.(int) -> void to void Function(int). This is more consistent with the syntax of Dart, and it will avoid ambiguities when nullability is added to the type system. This impacts to value returned by FunctionType.displayName and FunctionType.toString and ExecutableElement.toString. Client code might be broken if it depends on the content of the returned value.parseString to the public API. This can be used in place of the deprecated functions parseCompilationUnit and parseDirectives. Note that there is no option to parse only directives, since this functionality is broken anyway (parseDirectives, despite its name, parses the entire compilation unit).ClassTypeAlias.declaredElement to ClassElement. There is no functional change; it has always returned an instance of ClassElement.parseFile. Please use parseFile2 instead--in addition to supporting the same featureSet and throwIfDiagnostics parameters as parseString, it is much more efficient than parseFile.package:analyzer/analyzer.dart to direct clients to suitable replacements.bogus-disabled and bogus-enabled. Clients should not be relying on the presence of these flags.AstFactory.compilationUnit. In a future analyzer release, this method will be changed so that all its parameters are named parameters. Clients wishing to prepare for this should switch to using AstFactory.compilationUnit2.enableControlFlowCollections, enableNonNullable, enableSpreadCollections, and enableTripleShift, as well as the recently-introduced method configureFeatures. Parsers should now be configured by passing a FeatureSet object to the Parser constructor.AnalysisError.isStaticOnly.AnalysisError.offset setter.LinterContext.canBeConstConstructor.DartType.isUndefined, and now it always returns false.Expression.precedence to Precedence. Clients that prepared for this change by switching to Expression.precedence2 should now return to using Expression.precedence.ForEachStatement (use ForStatement instead)MapLiteral and MapLiteral2 (use SetOrMapLiteral instead)SetLiteral and SetLiteral2 (use SetOrMapLiteral instead)ListLiteral2 (use ListLiteral instead)ForStatement2 (use ForStatement instead)visitForEachStatement (override visitForStatement instead)visitMapLiteral and visitMapLiteral2 (override visitSetOrMapLiteral instead)visitSetLiteral and visitSetLiteral2 (override visitSetOrMapLiteral instead)visitListLiteral2 (override visitListLiteral instead)visitForStatement2 visit method (use VisitForStatement instead)mapLiteral and mapLiteral2 (use setOrMapLiteral instead)setLiteral and setLiteral2 (use setOrMapLiteral instead)listLiteral2 (use listLiteral instead)AstFactory.forStatement2, and introduced AstFactory.forStatement to replace itListLiteral.elements to NodeList<CollectionElement>ListLiteral.elements2 (use ListLiteral.elements instead)SetOrMapLiteral.elements2, and introduced SetOrMapLiteral.elements to replace itNodeLintRegistry.addForStatement2 (use NodeLintRegistry.addForStatement instead)ForEachStatement (use ForStatement2 instead)ForStatement (use ForStatement2 instead)MapLiteral (use SetOrMapLiteral instead)SetLiteral (use SetOrMapLiteral instead)visitForEachStatement (override visitForStatement2 instead)visitForStatement (override visitForStatement2 instead)visitMapLiteral (override visitSetOrMapLiteral instead)visitSetLiteral (override visitSetOrMapLiteral instead)mapLiteral and mapLiteral2 (use setOrMapLiteral instead)setLiteral and setLiteral2 (use setOrMapLiteral instead)package:html (see #35802)ForEachStatement (use ForStatement2 instead)ForStatement (use ForStatement2 instead)MapLiteral (use SetOrMapLiteral instead)SetLiteral (use SetOrMapLiteral instead)Expression.precedence. In analyzer version 0.36.0, its return type will be changed to Precedence. Clients that wish to prepare for the change can switch to Expression.precedence2.AstFactory.mapLiteral2 and AstFactory.setLiteral2 (replaced by AstFactory.setOrMapLiteral).AstVisitor.visitListLiteral2 (clients should not need to override this anymore).AstVisitor.visitMapLiteral2 and AstVisitor.visitSetLiteral2 (replaced by AstVisitor.visitSetOrMapLiteral).InheritanceManager class is now deprecated. The new InheritanceManager2 class now supports accessing inherited interface/class maps.AstVisitor, which will need to be implemented by any classes that implement AstVisitor directly. Concrete implementations were added to other visitor classes (such as RecursiveAstVisitor) so that clients that extend those other classes will not be impacted.EMPTY_LIST constants. Please use const <...>[] instead.AnalysisSession API.StrongTypeSystemImpl. Please use Dart2TypeSystem instead.@checked annotation. Please use the covariant keyword instead (#28797).@literal: NON_CONST_CALL_TO_LITERAL_CONSTRUCTOR.UriResolver documentation alerting clients of an upcoming breaking change.declarations-casts has been removed and the implicit-casts option now has the combined semantics of both options. This means that users that disable implicit-casts might now see errors that were not previously being reported.UriResolver documentation alerting clients of an upcoming breaking change.AstNode.getAncestor and introduced AstNode.thisOrAncestorMatching as its replacement.AnalysisOptions.strongMode flag. This is now hard-coded to always return true.const A(B()) if B is non-const).analyzer.dart's parseCompilationUnit().@isTest annotations (from package:meta) to the methods in their package which define a test.@isTest void myMagicTest(String name, FutureOr Function() body) { test(name, body); }
When subscribed to notifications for outlines of a test file, they will include elements for UNIT_TEST_GROUP and UNIT_TEST_TEST.
TOP_LEVEL_CYCLE to an error._InternalLinkedHashMap is not a subtype of HashMap in sdk 2.0.0-dev.22.0.NOTE This release was pulled from the package site due to an invalid SDK constraint that was fixed in 0.31.0+1.
A number of updates, including support for the new Function syntax.
null in the event that the given path is not part of a BazelWorkspace.astFactory, located in package:analyzer/dart/ast/standard_ast_factory.dart.Element.docRange.1.20.0-dev.1.0 SDK.1.18.0-dev.4.0 SDK._embedder.yaml discovery and processing.configureContext() extracted from server).AnalysisContext API for associating configuration data with contexts (setConfigurationData() and getConfigurationData()).OptionsProcessor extension point API changed to pass associated AnalysisContext instance into the optionsProcessed call-back.ErrorHandler typedef API fix..analysis_options..packages files (issue 24126)UriResolver.resolveUri(..) now takes an optional actualUri.ResolutionCopier.visitAwaitExpression to copy *Type fields.ClassName?.staticMember to match spec.UriResolver.resolveUri(..) that did not properly handle the new actualUri argument.dart:sdk extension .sdkext changed to _sdkext (to play nicer with pub).dart:sdk extensions from .sdkext..packages support.analyzer_cli package. Files moved:bin/analyzer.dartlib/options.dartlib/src/analyzer_impl.dartlib/src/error_formatter.dartargs package.New API:
Source.uri added.
Breaking changes:
DartSdk.fromEncoding replaced with fromFileUri.
Source.resolveRelative replaced with resolveRelativeUri.