Added the enabledExperiments parameter to AnalysisContextCollection to override experiments from analysis options files.
Fixed a regression in 14.2.0 through 14.5.0, where analyzer: exclude: patterns from an included options file, such as include: package:my_lints/options.yaml, were relative to the included file, so they did not exclude any files of the including package. These patterns are again relative to the folder of the analysis_options.yaml file at the start of the include: chain. See https://github.com/dart-lang/sdk/issues/64549.
Replaced the undefined_super_member diagnostic, which was reported for getters, methods, setters, and operators, with three diagnostics, as proposed in https://github.com/dart-lang/sdk/issues/64411:
undefined_super_member_read, for super.foo and super.foo(), when no superclass has a method, getter, or field that can be read. The message says when a superclass has only a setter, or a private member of another library.undefined_super_member_write, for super.foo = v, when no superclass has a setter. The message says when a superclass has only a getter, a final field, a method, or a private member of another library.undefined_super_operator, for super + v, -super, super[i], and super[i] = v.Replace undefined_super_member with the new names in // ignore: comments and in analysis_options.yaml, where the old name is still accepted, but has no effect.
Members of the interfaces that a class or mixin implements are no longer considered to be in a superclass. For example, super.foo() in mixin M implements A now reports undefined_super_member_read instead of abstract_super_member_reference, when only A has foo.
Extension overrides, such as E(x).foo, report two new diagnostics instead of undefined_extension_getter, undefined_extension_method, and undefined_extension_setter:
undefined_extension_member_read, for E(x).foo and E(x).foo(), when the extension doesn't declare a method or getter. The message says when the extension declares only a setter.undefined_extension_member_write, for E(x).foo = v, when the extension doesn't declare a setter. The message says when the extension declares only a getter, or a method.A private member of an extension declared in another library is no longer found through an extension override, such as E(x)._foo, and the message says that it is private.
Use the new names in // ignore: comments and in analysis_options.yaml for extension overrides.
Static member accesses, such as C.foo and E.foo, report two new diagnostics:
undefined_static_member_read, for C.foo and C.foo(), when the class, enum, mixin, extension type, or extension doesn't declare a static method, getter, or field, or an enum value. The message says when it declares only a setter or a private member in another library, or when the qualifier is a function type alias, which has no static members.undefined_static_member_write, for C.foo = v, when the target doesn't declare a static setter. The message says when it declares only a getter, a final or constant field, a method, or a private member in another library.These replace undefined_enum_constant, undefined_extension_getter, undefined_extension_method, undefined_extension_setter, and private_setter entirely, as well as undefined_getter, undefined_setter, and undefined_method for static members. A private static member of an extension declared in another library, such as E._foo, is no longer found.
Replace the removed names with the new names in // ignore: comments and in analysis_options.yaml, where the old names are still accepted but have no effect.
Dot shorthands, such as .foo and .foo(), report undefined_static_member_read instead of dot_shorthand_undefined_member, with a message that names the context type. A dot shorthand whose context type has no static members, such as a function type, or is a private class of another library, reports it too, instead of dot_shorthand_missing_context, which is now reported only when there is no context type. Replace dot_shorthand_undefined_member in // ignore: comments and in analysis_options.yaml.
Reads of instance members, such as x.foo, x.foo(), x.foo += 1, and the field foo of an object pattern C(foo: _), report undefined_instance_member_read when neither the static type of the receiver nor an applicable extension has a method, getter, or field named foo. The message says when there is only a setter, or a private member of another library, including a member of an extension. This replaces undefined_getter, and undefined_method for invocations with a receiver; undefined_method is still reported for invocations without a receiver, such as foo() inside a class. Replace undefined_getter in // ignore: comments and in analysis_options.yaml, where it is still accepted, but has no effect.
Writes of instance members, such as x.foo = v and x.foo += 1, report undefined_instance_member_write when neither the static type of the receiver nor an applicable extension has a setter named foo. The message says when there is only a getter, including a field of a record, a final field, a method, or a private member of another library. This replaces undefined_setter, and assignment_to_final, assignment_to_final_no_setter, and assignment_to_method for instance members; these three are still reported for unqualified names, such as foo = v inside a class. A read-write operation, such as x.foo += 1, reports only the read when both the read and the write fail. Replace undefined_setter in // ignore: comments and in analysis_options.yaml, where it is still accepted, but has no effect.
Names imported with a prefix, such as p.foo, report two new diagnostics instead of undefined_prefixed_name:
undefined_prefixed_name_read, for p.foo, p.foo(), and the read of p.foo += 1, when no library imported with the prefix has a getter, function, variable, or type named foo. This replaces undefined_function for prefixed invocations. The message says when there is only a setter, or a private declaration of an imported library.undefined_prefixed_name_write, for p.foo = v, when no library imported with the prefix has a setter named foo. The message says when there is only a getter, a final or constant variable, a function or a type, or a private declaration of an imported library. Before, all of these reported that foo isn't defined.Replace undefined_prefixed_name with the new names in // ignore: comments and in analysis_options.yaml, where it is still accepted, but has no effect.
Names without a qualifier, such as foo, foo(), and foo = v, report two new diagnostics:
undefined_unqualified_name_read, for foo, foo(), foo<int>, and the read of foo += 1, when no variable, getter, function, method, or type named foo is in scope. This replaces undefined_identifier for reads, undefined_function, and undefined_method for invocations without a receiver. The message says when there is only a setter.undefined_unqualified_name_write, for foo = v, the write of foo += 1, for (foo in xs), and (foo) = r, when no setter or variable named foo is in scope. This replaces undefined_identifier for writes, and assignment_to_const, assignment_to_final, assignment_to_final_no_setter, assignment_to_function, assignment_to_method, and assignment_to_type. The message says when there is only a getter, a final or constant variable, or a function, method, or type.An assignment to an erroneously constant instance field, or to an instance field declared in an extension, no longer reports anything at the assignment; the declaration already reports const_instance_field or extension_declares_instance_field. A read-write operation, such as foo += 1, reports only the read when both the read and the write fail.
Replace the removed names with the new names in // ignore: comments and in analysis_options.yaml, where they are still accepted, but have no effect.
A name in a constant expression whose read is already reported as invalid, such as an undefined name in const x = foo;, const y = [C.foo];, const z = 'abc'.lenght;, or @A(p.foo), no longer also reports that the expression isn't constant, for example const_initialized_with_non_constant_value, non_constant_list_element, const_eval_property_access, or const_with_non_constant_argument. The same applies to the initializers of a constant constructor, such as const A() : f = foo;, which no longer also reports invalid_constant there, or invalid_constant at each invocation such as const A(). ElementAnnotation.constantEvaluationErrors still includes these errors.
languageVersionOverride parameter to AnalysisContextCollection to override the default language version for non-SDK files.new keyword in comment references. Text such as [new C] in a documentation comment is no longer a comment reference, so it isn't resolved, indexed, or renamed. Use [C.new] instead.CommentReference.newKeyword. It now always returns null.deprecated_new_in_comment_reference diagnostic, along with its quick fix.dead_code for a loop over an expression of type Never starts at the loop body instead of the loop variable.@C(args), is the constructor invocation const C(args). Annotations report the same diagnostics as the equivalent constant expressions, usually at the name or the argument instead of the whole annotation:undefined_identifier or undefined_prefixed_name for undefined names.creation_with_non_type for @f(), where f isn't a class.const_with_undefined_constructor for undefined constructors.const_with_non_const for constructors that aren't const.const_deferred_class for constructors of classes from a deferred library. invalid_annotation_from_deferred_library is still reported for annotations without arguments.wrong_number_of_type_arguments for the type as written, such as a type alias, instead of the class that it denotes.const_constructor_param_type_mismatch in addition to argument_type_not_assignable, as for const C(...).invalid_reference_to_generative_enum_constructor for @E(), where E is an enum, and instantiate_abstract_class for @C(), where C is abstract. These weren't reported before.undefined_annotation diagnostic. It was reported only when the first name of an annotation was undefined, while an undefined name after a class, as in @Foo.bar, was reported as invalid_annotation. Annotations that aren't identifiers, such as @1 or @'string', report only the syntax error.non_constant_annotation_constructor diagnostic. @C(), where the constructor isn't const, reports const_with_non_const. @C and @C.named report no_annotation_constructor_arguments whether or not the constructor is const.invalid_annotation is reported only for an annotation without arguments that references neither a constant variable nor a constructor, such as a getter or a function. It‘s no longer reported for undefined names, undefined constructors, invocations of things that aren’t classes, or in addition to ambiguous_import or annotation_with_type_arguments_uninstantiated.missing_required_argument for an annotation highlights the constructor reference, such as A.named or p.A, and inference_failure_on_instance_creation highlights the class name, instead of the whole annotation.const_with_non_constant_argument is no longer reported in addition to const_with_non_const for an invocation of a constructor that isn't const in the arguments of an annotation.const_with_non_constant_argument, like a positional argument, instead of invalid_constant.ElementAnnotation.constantEvaluationErrors reports the same error as the diagnostic for the annotation. For example, for @A(x), where x isn't a constant, it is now const_with_non_constant_argument instead of invalid_constant./// @docImport 'dart:io' as io;. Documentation comments can reference [io.File], and the prefix itself as [io]. The prefix is a PrefixElement whose imports are the doc imports with this prefix; it isn't included into LibraryFragment.prefixes. Removed the doc_import_cannot_have_prefix diagnostic.show / hide combinators are applied. Removed the doc_import_cannot_have_combinators diagnostic.PrefixElement.scopeLibraries, the libraries that provide the names in PrefixElement.scope. Unlike imports, it includes the libraries imported with the same prefix in the enclosing files. When a prefix is used alone, such as [math] in a documentation comment, it references the library, if there is exactly one.ambiguous_comment_reference warning. It is reported for a name in a comment reference that is imported, or doc-imported, from more than one library, and for a prefix used alone, such as [p], when more than one library is imported with this prefix.CompilationUnit.lookupThisType, which queries the type of this at an arbitrary offset within the compilation unit.FunctionBody.lookupThisType. Use CompilationUnit.lookupThisType instead; unlike the removed method, it also works at offsets that aren't inside a function body (for example inside the initializer of a late instance field).14.2.0 was retracted because of adding acccidental files.FormalParameterList.requiredPositionalFormalParameters, FormalParameterList.delimitedFormalParameters, and the DelimitedFormalParameters node.FormalParameterElement.isInitializingFormal. Use type checks (element is FieldFormalParameterElement) instead.FormalParameterElement.isSuperFormal. Use type checks (element is SuperFormalParameterElement) instead.PackageConfigFileBuilder from package:analyzer/utilities/package_config_file_builder.dart. Use package:analyzer_testing/package_config_file_builder.dart instead.FormalParameterElement.formalParameters. Use FormalParameterElement.type instead.FormalParameterElement.typeParameters. Use FormalParameterElement.type instead.Folder.getFile, deprecate Folder.getChildAssumingFile.Folder.getFolder, deprecate Folder.getChildAssumingFolder.3.x.x.FormalParameterElement.formalParameters and typeParameters. Use FormalParameterElement.type instead.isComplete to ConstructorDeclaration, FunctionDeclaration, and MethodDeclaration.MethodDeclaration.isAbstract. Use !isComplete instead.excludedPaths parameter in AnalysisContextCollection. Use analysis_options.yaml to configure excluded paths instead.PackageConfigFileBuilder in package:analyzer/utilities/package_config_file_builder.dart. Use package:analyzer_testing/package_config_file_builder.dart instead.isInitializingFormal in FormalParameterElement. Use type checks (element is FieldFormalParameterElement) instead.isSuperFormal in FormalParameterElement. Use type checks (element is SuperFormalParameterElement) instead.ExtensionTypeDeclaration.primaryConstructor. Use ExtensionTypeDeclaration.namePart instead.MixinFragment.superclassConstraints has been removed. Use fragment.element.superclassConstraints instead.DefaultFormalParameter has been removed. Default values for parameters are now represented compositionally via a defaultClause property on all FormalParameter nodes.SimpleFormalParameter and FunctionTypedFormalParameter have been removed and replaced by RegularFormalParameter.functionTypedSuffix property on FormalParameter.NormalFormalParameter has been removed from the AST hierarchy.AstVisitor methods visitDefaultFormalParameter, visitSimpleFormalParameter, and visitFunctionTypedFormalParameter have been removed. Use visitRegularFormalParameter instead for standard parameters.FormalParameterDefaultClause and FunctionTypedFormalParameterSuffix AST nodes to represent parameter defaults and function-typed parameter structures.NamedExpression has been removed and replaced with NamedArgument in ArgumentList and RecordLiteralNamedField in RecordLiteral.Argument and RecordLiteralField AST node interfaces, which Expression now implements.ArgumentList.arguments now returns NodeList<Argument> instead of NodeList<Expression>.RecordLiteral.fields now returns NodeList<RecordLiteralField> instead of NodeList<Expression>.AstVisitor.visitNamedExpression has been removed. Use visitNamedArgument and visitRecordLiteralNamedField instead.FormalParameterElement.firstFragment and .fragments now return FormalParameterFragment (instead of specific parameter fragment subtypes like FieldFormalParameterFragment), making formal parameter fragments heterogeneous to support augmentations.LabelReference AST node to represent references to labels without them being in the expression hierarchy.Label now uses a Token name instead of SimpleIdentifier label.BreakStatement.label and ContinueStatement.label now return LabelReference? instead of SimpleIdentifier?.InterfaceType.inheritedConcreteMembers and InterfaceType.interfaceMembers.dynamic, Never, and void. As a result, it is no longer safe to assume that there is a single instance of DynamicType, NeverType, or VoidType. Use type checks (is DynamicType) instead of identical().InstantiatedTypeAliasElement.nullabilitySuffix.;) in enums, extensions, and mixins, representing them in the AST with EmptyEnumBody and EmptyClassBody.ClassBody is now a sealed class with subclasses BlockClassBody and EmptyClassBody. Getters like .members, .leftBracket, and .rightBracket are available on BlockClassBody. This affects ClassDeclaration, ExtensionDeclaration, and MixinDeclaration bodies.EnumBody is now a sealed class with subclasses BlockEnumBody and EmptyEnumBody. Getters like .members, .leftBracket, and .rightBracket are available on BlockEnumBody.LibraryIdentifier. LibraryDirective.name and PartOfDirective.libraryName now return DottedName?.DottedName.components (NodeList) is replaced with DottedName.tokens (List).ClassDeclaration.leftBracket.ClassDeclaration.members.ClassDeclaration.name.ClassDeclaration.rightBracket.ClassDeclaration.typeParameters.EnumDeclaration.constants.EnumDeclaration.leftBracket.EnumDeclaration.members.EnumDeclaration.name.EnumDeclaration.rightBracket.EnumDeclaration.semicolon.EnumDeclaration.typeParameters.ExtensionDeclaration.leftBracket.ExtensionDeclaration.members.ExtensionDeclaration.rightBracket.ExtensionTypeDeclaration.constKeyword.ExtensionTypeDeclaration.leftBracket.ExtensionTypeDeclaration.members.ExtensionTypeDeclaration.name.ExtensionTypeDeclaration.representation.ExtensionTypeDeclaration.rightBracket.ExtensionTypeDeclaration.typeParameters.ConstructorDeclaration.returnType.MixinDeclaration.leftBracket.MixinDeclaration.members.MixinDeclaration.rightBracket.NamedCompilationUnitMember.RepresentationConstructorName.RepresentationDeclaration.ConstructorElement.isSynthetic.ConstructorFragment.isSynthetic.Element.isSynthetic.ExecutableFragment.isSynthetic.PropertyAccessorElement.isSynthetic.PropertyInducingElement.isSynthetic.PropertyInducingFragment.isSynthetic.visitNamedCompilationUnitMember.visitRepresentationConstructorName.visitRepresentationDeclaration.RuleVisitorRegistry.addRepresentationConstructorName.RuleVisitorRegistry.addRepresentationDeclaration.ClassDeclaration, EnumDeclaration, FunctionDeclaration, MixinDeclaration, and TypeAlias now implement CompilationUnitMember directly (instead of NamedCompilationUnitMember).RuleVisitorRegistry.addRepresentationConstructorName.RuleVisitorRegistry.addRepresentationDeclaration.TypeSystem.futureValueType.ConstructorElement.isDeclaring.ConstructorElement.isPrimary.FieldElement.declaringFormalParameter.FieldFormalParameterElement.isDeclaring and privateName.FieldFormalParameterFragment.privateName.LibraryFragment.isSynthetic, use isOriginNotExistingFile instead.dynamic, or Never) in a value expression slot are now represented as TypeLiteral nodes instead of SimpleIdentifier or PrefixedIdentifier nodes (Issues 62763, 63113).ClassDeclaration:leftBracket, members, rightBracket are deprecated; use body instead.name, typeParameters are deprecated; use namePart instead.EnumDeclaration:leftBracket, constants, members, rightBracket are deprecated; use body instead.name, typeParameters are deprecated; use namePart instead.ExtensionDeclaration:leftBracket, members, rightBracket are deprecated; use body instead.ExtensionTypeDeclaration:leftBracket, constants, members, rightBracket are deprecated; use body instead.constKeyword, name, representation, typeParameters are deprecated; use primaryConstructor instead.DiagnosticOrErrorListener and the DiagnosticOrErrorListenerExtension extension.RecordingDiagnosticListener.onError and BooleanDiagnosticListener.onError methods.LintCode.new's hasPublishedDocs parameter.RemovedAnalysisRule as the preferred way to represent removed lint rules. Deprecated RuleState.removed (which was the previous way to do so).ConstructorElement.isSynthetic. Use isOriginDeclaration, isOriginImplicitDefault, isOriginMixinApplication instead.TopLevelVariableElement.isSynthetic. Use isOriginDeclaration, isOriginGetterSetter.FieldElement.isSynthetic. Use isOriginDeclaration, isOriginGetterSetter, isOriginDeclaringFormalParameter, isOriginEnumValues instead.PropertyAccessorElement.isSynthetic. Use isOriginDeclaration, isOriginInterface, isOriginVariable instead.Element.isSynthetic; use isOriginXyz properties instead.LibraryElement.isSynthetic; use isOriginNotExistingFile instead.SyntacticEntity is not intended to be subclassed by clients.DiagnosticCode.name and DiagnosticCode.uniqueName. Use DiagnosticCode.lowerCaseName and DiagnosticCode.lowerCaseUniqueName instead.GitPluginSource, PathPluginSource, PluginConfiguration, PluginSource, VersionedPluginSource from the public API.AnalysisOptions.pluginConfigurations.Diagnostic.data.DiagnosticReporter.atOffset and the constructors Diagnostic.tmp and Diagnostic.forValues, remove the deprecated named parameter errorCode, and make the named parameter diagnosticCode non-nullable and required.DiagnosticReporter.atOffset named parameter, errorCode.BooleanErrorListener.RecordingErrorListener.AnalysisErrorListener.NULL_LISTENER.AstNodeExtension.NullShortableExpression.PartDirective.configurations.TypeDefiningElement.TypeAliasElement.aliasedElement.resolveFile2.ErrorCode.ErrorSeverity.ErrorType.AnalysisErrorListener.RecordingDiagnosticListener.errors.RecordingDiagnosticListener.getErrorForSource.BooleanDiagnosticListener.onError in favor of .onDiagnostic.RecordingDiagnosticListener.onError in favor of .onDiagnostic.DiagnosticOrErrorListener in favor of DiagnosticListener.experimental_member_use warning, which warns about any reference to a declaration annotated with @experimental.TypeAliasElement.aliasedElement, use aliasedType instead.TypeDefiningElement, check for specific elements.TypeDefiningFragment, check for specific fragments.PartDirective.configurations, removed from the specification.^3.9.0.Diagnostic.data. Instead, please use an expando to attach data to the Diagnostic object.CatchClauseParameter.declaredElement and CatchClauseParameter.declaredElement2. Use CatchClauseParameter.declaredFragment instead.DeclaredIdentifier.declaredElement and DeclaredIdentifier.declaredElement2. Use DeclaredIdentifier.declaredFragment instead.DeclaredVariablePattern.declaredElement and DeclaredVariablePattern.declaredElement2. Use DeclaredVariablePattern.declaredFragment instead.VariableDeclaration.declaredElement and VariableDeclaration.declaredElement2. Use VariableDeclaration.declaredFragment instead.InterfaceFragment.interfaces, use InterfaceElement.interfaces instead.InterfaceFragment.mixins, use InterfaceElement.mixins instead.InterfaceFragment.supertype, use InterfaceElement.supertype instead.ExtensionTypeFragment.primaryConstructor, use ExtensionTypeElement.primaryConstructor.ExtensionTypeFragment.representation, use ExtensionTypeElement.representation.NullShortableExpression. This interface should not be needed by analyzer clients, and is no longer supported.EnumSet usage when compiled to JavaScript.DartObject.constructorInvocation with the constructor and arguments.PropertyAccessorElement.variable non-nullable.documentationComment to Element and Fragment.metadata to Element and Fragment.metadata to ElementDirective.partKeywordOffset to PartInclude.package:build.LibraryElementResult.element2, use element instead.ResolvedLibraryResult.element2, use element instead.ResolvedUnitResult.libraryElement2, use libraryElement instead.AnalysisSession.getParsedLibraryByElement2, use getParsedLibraryByElement instead.AnalysisSession.getResolvedLibraryByElement2, use getResolvedLibraryByElement instead.resolveFile2, use resolveFile instead.DartObject.variable2, use variable instead.DartObject.toFunctionValue2, use toFunctionValue instead.Annotatable, use documentationComment and metadata of Element or Fragment directly.ClassElement.isExtendableIn; use isExtendableOutside instead.ClassElement.isImplementableIn; use isImplementableOutside instead.ClassElement.isMixableIn; use isMixableOutside instead.MixinElement.isImplementableIn; use isImplementableOutside instead.DartType.isStructurallyEqualTo.RecordType.positionalTypes.RecordType.sortedNamedTypes.ElementLocation class; its values are not returned anymore.AnalysisContext.analysisOptions.PromotableElement and PromotableFragment.LocalVariableElement.hasInitializer.LocalVariableFragment.hasInitializer.LocalVariableFragment.nameOffset.JoinPatternVariableFragment.isConsistent.JoinPatternVariableFragment.variables2.VariableElement.constantInitializer2.VariableFragment.initializer.ConstantInitializer.HasSinceSdkVersion.LibraryFragment is not Annotatable anymore.ConstantEvaluationTarget by ElementAnnotation. This is an internal interface that should not have been exposed.element2.dart library; import element.dart.XyzElement2 classes; use XyzElement instead.AnalysisError.correction field; use AnalysisError.correctionMessage instead.AnalysisError; use Diagnostic instead.ErrorCode; use DiagnosticCode instead.ErrorReporter.atOffset's errorCode parameter; use diagnosticCode instead.ErrorSeverity; use DiagnosticSeverity instead.DiagnosticCode.errorSeverity; use DiagnosticCode.diagnosticSeverity instead.AnalysisErrorListener, BooleanErrorListener, and RecordingErrorListener; use DiagnosticListener, BooleanDiagnosticListener, and RecordingDiagnosticListener respectively, instead. Instead of calling or overriding AnalysisErrorListener.onError, call or override DiagnosticListener.onDiagnostic. Instead of using AnalysisErrorListener.NULL_LISTENER, use DiagnosticListener.nullListener.RecordingErrorListener.errors; use RecordingDiagnosticListener.diagnostics instead.RecordingErrorListener.getErrorsForSource; no longer supported.AnalysisResultWithErrors; use AnalysisResultWithDiagnostics instead.AnalysisResultWithErrors.errors; use AnalysisResultWithErrors.diagnostics instead.ErrorType; use DiagnosticType instead.ElementDirective from sealed to abstract. This allows the analyzer to have an internal implementation class corresponding to ElementDirective.NamedType.name2, use name instead.ClassElement.isXyzIn2, use isXyzIn instead.Element.enclosingElement2, use enclosingElement instead.InstanceElement.fields2, use fields instead.InstanceElement.getters2, use getters instead.InstanceElement.setters2, use setters instead.InstanceElement.methods2, use methods instead.InstanceElement.getField2, use getField instead.InstanceElement.getGetter2, use getGetter instead.InstanceElement.getSetter2, use getSetter instead.InstanceElement.getMethod2, use getMethod instead.InstanceFragment.fields2, use fields instead.InstanceFragment.methods2, use methods instead.InterfaceElement.constructors2, use constructors instead.InterfaceFragment.constructors2, use constructors instead.JoinPatternVariableElement.variables2, use variables instead.Annotatable.metadata2, use metadata instead.Element.nonSynthetic2, use nonSynthetic instead.Element.library2, use library instead.ExtensionTypeElement.primaryConstructor2, use primaryConstructor instead.ExtensionTypeElement.representation2, use representation instead.ExtensionTypeFragment.primaryConstructor2, use primaryConstructor instead.ExtensionTypeFragment.representation2, use representation instead.InterfaceType.getGetter2, use getGetter instead.InterfaceType.getMethod2, use getMethod instead.InterfaceType.getSetter2, use getSetter instead.InterfaceType.lookUpConstructor2, use lookUpConstructor instead.InterfaceType.lookUpGetter3, use lookUpGetter instead.InterfaceType.lookUpMethod3, use lookUpMethod instead.InterfaceType.lookUpSetter3, use lookUpSetter instead.PropertyAccessorFragmentImplImplicitGetter, PropertyAccessorFragmentImplImplicitSetter, and FormalParameterFragmentImplOfImplicitSetter, replace with GetterFragmentImpl, and SetterFragmentImpl.ExtensionTypeFragment.representation2, use representation instead.DartType.element3, use element instead.LibraryElement.loadLibraryFunction2, use loadLibraryFunction instead.InterfaceType.constructors2, use constructors instead.Element.accept2, use accept instead.InstantiatedTypeAliasElement.element2, use element instead.TypeProvider.boolElement2, use boolElement instead.TypeProvider.doubleElement2, use doubleElement instead.TypeProvider.enumElement2, use enumElement instead.TypeProvider.futureElement2, use futureElement instead.TypeProvider.futureOrElement2, use futureOrElement instead.TypeProvider.intElement2, use intElement instead.TypeProvider.iterableElement2, use iterableElement instead.TypeProvider.listElement2, use listElement instead.TypeProvider.mapElement2, use mapElement instead.TypeProvider.nullElement2, use nullElement instead.TypeProvider.numElement2, use numElement instead.TypeProvider.objectElement2, use objectElement instead.TypeProvider.recordElement2, use recordElement instead.TypeProvider.setElement2, use setElement instead.TypeProvider.streamElement2, use streamElement instead.TypeProvider.stringElement2, use stringElement instead.TypeProvider.symbolElement2, use symbolElement instead.Annotation.element2, use element instead.LibraryDirective.name2, use name instead.CatchClauseParameter.declaredElement2, use declaredElement instead.CompoundAssignmentExpression.readElement2, use readElement instead.CompoundAssignmentExpression.writeElement2, use writeElement instead.DeclaredIdentifier.declaredElement2, use declaredElement instead.DeclaredVariablePattern.declaredElement2, use declaredElement instead.EnumConstantDeclaration.constructorElement2, use constructorElement instead.ExtensionOverride.element2, use element instead.FunctionBody.isPotentiallyMutatedInScope2, use isPotentiallyMutatedInScope instead.ImportPrefixReference.element2, use element instead.LibraryDirective.element2, use element instead.LibraryDirective.name2, use name instead.NamedExpression.element2, use element instead.NamedType.element2, use element instead.PatternField.element2, use element instead.RelationalPattern.element2, use element instead.VariableDeclaration.declaredElement2, use declaredElement instead.InterfaceType.methods2, use methods instead.Fragment.name2, use name instead.Element.name3, use name instead.ConstructorElement.redirectedConstructor2, use redirectedConstructor instead.ConstructorElement.superConstructor2, use superConstructorË™ instead.Element.children2, use children instead.Element.displayString2, use displayString instead.Element.getExtendedDisplayName2, use getExtendedDisplayName instead.Element.isAccessibleIn2, use isAccessibleIn instead.Element.thisOrAncestorMatching2, use thisOrAncestorMatching instead.Element.thisOrAncestorOfType2, use thisOrAncestorOfType instead.EnumElement.constants2, use constants instead.FieldFormalParameterElement.field2, use field instead.FormalParameterElement.typeParameters2, use typeParameters instead.Fragment.children3, use children instead.DartType.asInstanceOf2, use asInstanceOf instead.TypeSystem.instantiateInterfaceToBounds2, use instantiateInterfaceToBounds instead.TypeSystem.instantiateTypeAliasToBounds2, use instantiateTypeAliasToBounds instead.FormalParameterElement.appendToWithoutDelimiters, use appendToWithoutDelimiters instead.GetterElement.correspondingSetter2, use correspondingSetter instead.InterfaceElement.unnamedConstructor2, use unnamedConstructor instead.InterfaceElement.getNamedConstructor2, use getNamedConstructor instead.TypeParameterizedElement.typeParameters2, use typeParameters instead.FormalParameterElement.appendToWithoutDelimiters2, use appendToWithoutDelimiters instead.GetterElement.correspondingSetter2, use correspondingSetter instead.InterfaceElement.unnamedConstructor2, use unnamedConstructor instead.InterfaceElement.getNamedConstructor2, use getNamedConstructor instead.LibraryElement.entryPoint2, use entryPoint instead.LibraryElement.exportedLibraries2, use exportedLibraries instead.LibraryElement.getClass2, use getClass instead.LibraryElement.getEnum2, use getEnum instead.LibraryElement.getMixin2, use getMixin instead.LibraryExport.exportedLibrary2, use exportedLibrary instead.LibraryFragment.accessibleExtensions2, use accessibleExtensions instead.LibraryFragment.importedLibraries2, use importedLibraries instead.LibraryImport.importedLibrary2, use importedLibrary instead.MixinElement.isImplementableIn2, use isImplementableIn instead.PatternVariableElement.join2, use join instead.PropertyAccessorElement.variable3, use variable instead.PropertyInducingElement.getter2, use getter instead.PropertyInducingElement.setter2, use setter instead.SetterElement.correspondingGetter2, use correspondingGetter instead.SuperFormalParameterElement.superConstructorParameter2, use superConstructorParameter instead.TypeAliasElement.aliasedElement2, use aliasedElement instead.TypeParameterizedElement.typeParameters2, use typeParameters instead.VariableElement.constantInitializer2, use constantInitializer instead.TypeProvider.isNonSubtypableClass2, use isNonSubtypableClass instead.EnumFragment.constants2, use constants instead.InterfaceElement.lookUpInheritedMethod2, use lookUpInheritedMethod instead.LibraryFragment.classes2, use classes instead.LibraryFragment.enums2, use enums instead.LibraryFragment.extensionTypes2, use extensionTypes instead.LibraryFragment.extensions2, use extensions instead.LibraryFragment.functions2, use functions instead.LibraryFragment.libraryExports2, use libraryExports instead.LibraryFragment.libraryImports2, use libraryImports instead.LibraryFragment.mixins2, use mixins instead.LibraryFragment.topLevelVariables2, use topLevelVariables instead.LibraryFragment.typeAliases2, use typeAliases instead.PatternVariableFragment.join2, use join instead.LibraryFragment.isNonSubtypableClass2, use isNonSubtypableClass instead.TypeParameterizedFragment.typeParameters2, use typeParameters instead.Fragment.nameOffset2, use nameOffset instead.DirectiveUriWithLibrary.library2, use library instead.ElementAnnotation.element2, use element instead.LibraryImport.prefix2, use prefix instead.MultiplyDefinedElement.conflictingElements2, use conflictingElements instead.ScopeLookupResult.getter2, use getter instead.ScopeLookupResult.setter2, use setter instead.HasSinceSdkVersion, use Element2.sinceSdkVersion.VariableElement.constantInitializer2, use constantInitializer instead.VariableFragment.initializer, use VariableElement.constantInitializer instead.ConstantInitializer.JoinPatternVariableFragment.isConsistent and variables2. Use corresponding properties of JoinPatternVariableElement2 instead.LocalVariableFragment.nameOffset, use nameOffset2 instead.EnumFragment.constants2, use EnumElement2.constants2 instead.LocalVariableElement.hasInitializer and LocalVariableFragment.hasInitializer. This property is not useful and was not de-facto used.PromotableFragment and PromotableElement. These interfaces are implementation details.AugmentedExpression and AugmentedInvocation. This feature was removed from the specification.LibraryElement.identifier, use uri instead.LibraryElement2.identifier, use uri instead.ConstantEvaluationTarget itself, and its methods.AnalysisTarget.api.txt manifest.ElementAnnotation from ConstantEvaluationTarget.ElementAnnotation will stop implementing ConstantEvaluationTarget.ElementAnnotation.libraryFragment, as the replacement for the deprecations above. It provides enough information about the location.PropertyAccessorFragment.variable3. Use PropertyAccessorElement2.variable3 instead.PropertyInducingFragment.getter2. Use PropertyInducingElement2.getter2 instead.PropertyInducingFragment.setter2. Use PropertyInducingElement2.setter2 instead.LabelElement2.PrefixElement2.InstanceElement.augmented getter. This API was removed in 7.4.0 under the assumption that its removal would not be a breaking change, because it was marked as @experimental. But it turns out that some clients had been published to pub that relied on it. So, these APIs were restored, and implemented on top of Element2.^3.5.0.flags optional named parameter to FeatureSet.latestLanguageVersion().ElementDirective as superinterface for LibraryExport, LibraryImport, and PartInclude. It implements Annotatable.DartType.element2.DartType.isDynamic.DartType.isVoid.DartType.resolveToBound.IfElement.condition.IfStatement.condition.AstNode.getProperty and AstNode.setProperty.File.createSource(), it violates levels of abstraction. You can get Source instances from AnalysisResults.LibraryElement.toLegacyTypeIfOptOut.LibraryElement.toLegacyElementIfOptOut.LibraryElement.isNonNullableByDefault.File.changes and Folder.changes.Resource.parent2.OnClause.ContextBuilder, use AnalysisContextCollection.ContextLocator, use AnalysisContextCollection.ClassOrAugmentationDeclaration..MixinOrAugmentationDeclaration..AnalysisError.TypeSystem.instantiateToBounds2.buildSdkSummary2().FileSource.fileReadMode.ErrorReporter.Comment.isBlock, isDocumentation, isEndOfLine.Element.enclosingElement.PropertyAccessor.variable.LibraryOrAugmentationElement.LibraryElement properties.enabledPluginNames and hint from AnalysisOptions.source_io.dart.lint/Spelunker.source_resource.dart.MultiplyInheritedExecutableElement.AnalyzeFunctionBodiesPredicate.normalParameterNames and optionalParameterNames from FunctionType.LibraryElement.exportedLibraries.LibraryElement.importedLibraries.LibraryElement.accessibleExtensions, use CompilationUnitElement.accessibleExtensions instead.LibraryElement.exportedLibraries.LibraryElement.importedLibraries.LibraryElement.isBrowserApplication.LibraryElement.libraryExports, use CompilationUnitElement.libraryExports instead.LibraryElement.libraryImports, use CompilationUnitElement.libraryImports instead.LibraryElement.prefixes, use CompilationUnitElement.libraryImportPrefixes instead.LibraryElement.parts, use CompilationUnitElement.parts instead.LibraryElement.scope, use CompilationUnitElement.scope instead.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.