diff --git a/CHANGELOG.md b/CHANGELOG.md index 653f5590fe..9dfd9abce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 8.3.3-wip * Require Dart 3.6 or later. +* Require analyzer 7.2.0 APIs. ## 8.3.2 diff --git a/lib/src/generator/templates.runtime_renderers.dart b/lib/src/generator/templates.runtime_renderers.dart index 8eb1729777..1c4933b30a 100644 --- a/lib/src/generator/templates.runtime_renderers.dart +++ b/lib/src/generator/templates.runtime_renderers.dart @@ -25637,7 +25637,6 @@ const _invisibleGetters = { 'accessibleExtensions', 'accessors', 'classes', - 'enclosingElement', 'enclosingElement3', 'enums', 'extensionTypes', @@ -25667,7 +25666,6 @@ const _invisibleGetters = { 'augmentationTarget', 'declaration', 'displayName', - 'enclosingElement', 'enclosingElement3', 'hashCode', 'isConst', @@ -25694,7 +25692,6 @@ const _invisibleGetters = { 'DartType': { 'alias', 'element', - 'element2', 'element3', 'extensionTypeErasure', 'hashCode', @@ -25718,8 +25715,6 @@ const _invisibleGetters = { 'isDartCoreString', 'isDartCoreSymbol', 'isDartCoreType', - 'isDynamic', - 'isVoid', 'name', 'nullabilitySuffix', 'runtimeType', @@ -25784,7 +25779,6 @@ const _invisibleGetters = { 'declaration', 'displayName', 'documentationComment', - 'enclosingElement', 'enclosingElement3', 'hasAlwaysThrows', 'hasDeprecated', @@ -25846,10 +25840,10 @@ const _invisibleGetters = { 'declaration', 'displayName', 'documentationComment', - 'enclosingElement', 'enclosingElement2', 'enclosingElement3', 'formalParameters', + 'fragments', 'hasAlwaysThrows', 'hasDeprecated', 'hasDoNotStore', @@ -25899,6 +25893,7 @@ const _invisibleGetters = { 'librarySource', 'location', 'metadata', + 'metadata2', 'name', 'nameLength', 'nameOffset', @@ -25945,13 +25940,7 @@ const _invisibleGetters = { 'isStatic', 'runtimeType', }, - 'File': { - 'changes', - 'hashCode', - 'lengthSync', - 'modificationStamp', - 'runtimeType', - }, + 'File': {'hashCode', 'lengthSync', 'modificationStamp', 'runtimeType'}, 'FunctionElement': { 'augmentation', 'augmentationTarget', @@ -25962,17 +25951,17 @@ const _invisibleGetters = { }, 'FunctionType': { 'element', - 'element2', 'formalParameters', 'hashCode', 'namedParameterTypes', - 'normalParameterNames', 'normalParameterTypes', - 'optionalParameterNames', 'optionalParameterTypes', 'parameters', + 'positionalParameterTypes', + 'requiredPositionalParameterCount', 'returnType', 'runtimeType', + 'sortedNamedParameters', 'typeFormals', 'typeParameters', }, @@ -26061,23 +26050,28 @@ const _invisibleGetters = { }, 'Kind': {'hashCode', 'index', 'runtimeType'}, 'LibraryElement': { + 'definingCompilationUnit', 'enclosingElement3', 'entryPoint', 'exportNamespace', 'exportedLibraries', + 'featureSet', 'hashCode', 'identifier', 'importedLibraries', - 'isBrowserApplication', 'isDartAsync', 'isDartCore', 'isInSdk', + 'languageVersion', + 'library', 'loadLibraryFunction', 'name', - 'parts', 'publicNamespace', 'runtimeType', + 'session', 'topLevelElements', + 'typeProvider', + 'typeSystem', 'units', }, 'LibraryElement2': { @@ -26091,7 +26085,6 @@ const _invisibleGetters = { 'featureSet', 'firstFragment', 'fragments', - 'functions', 'getters', 'hashCode', 'identifier', @@ -26104,11 +26097,14 @@ const _invisibleGetters = { 'mixins', 'publicNamespace', 'runtimeType', + 'session', 'setters', + 'topLevelFunctions', 'topLevelVariables', 'typeAliases', 'typeProvider', 'typeSystem', + 'uri', }, 'List': {'hashCode', 'length', 'reversed', 'runtimeType'}, 'Locatable': { @@ -26136,7 +26132,6 @@ const _invisibleGetters = { 'declaration', 'displayName', 'documentationComment', - 'enclosingElement', 'enclosingElement3', 'hasAlwaysThrows', 'hasDeprecated', @@ -26175,6 +26170,7 @@ const _invisibleGetters = { 'librarySource', 'location', 'metadata', + 'metadata2', 'name', 'nameLength', 'nameOffset', @@ -26280,15 +26276,20 @@ const _invisibleGetters = { }, 'ParameterMember': { 'augmentationSubstitution', + 'baseElement', 'children', + 'children2', 'context', 'declaration', 'defaultValueCode', 'displayName', 'documentationComment', 'element', - 'enclosingElement', + 'enclosingElement2', 'enclosingElement3', + 'firstFragment', + 'formalParameters', + 'fragments', 'hasAlwaysThrows', 'hasDefaultValue', 'hasDeprecated', @@ -26333,13 +26334,19 @@ const _invisibleGetters = { 'isSynthetic', 'kind', 'library', + 'library2', 'librarySource', 'location', + 'lookupName', 'metadata', + 'metadata2', 'name', + 'name3', 'nameLength', 'nameOffset', + 'nameShared', 'nonSynthetic', + 'nonSynthetic2', 'parameterKind', 'parameters', 'runtimeType', @@ -26349,6 +26356,8 @@ const _invisibleGetters = { 'substitution', 'type', 'typeParameters', + 'typeParameters2', + 'typeShared', }, 'ParameterizedType': {'hashCode', 'runtimeType', 'typeArguments'}, 'PropertyAccessorElement': { @@ -26357,13 +26366,11 @@ const _invisibleGetters = { 'correspondingGetter', 'correspondingSetter', 'declaration', - 'enclosingElement', 'enclosingElement3', 'hashCode', 'isGetter', 'isSetter', 'runtimeType', - 'variable', 'variable2', }, 'Scope': {'hashCode', 'runtimeType'}, @@ -26388,7 +26395,6 @@ const _invisibleGetters = { 'TypeAliasElement': { 'aliasedElement', 'aliasedType', - 'enclosingElement', 'enclosingElement3', 'hashCode', 'isAugmentation', @@ -26400,8 +26406,8 @@ const _invisibleGetters = { 'aliasedType', 'enclosingElement2', 'firstFragment', + 'fragments', 'hashCode', - 'name', 'runtimeType', }, 'TypeParameterElement': { diff --git a/lib/src/model/typedef.dart b/lib/src/model/typedef.dart index 1834bda528..47f3806118 100644 --- a/lib/src/model/typedef.dart +++ b/lib/src/model/typedef.dart @@ -19,7 +19,7 @@ abstract class Typedef extends ModelElement @override final TypeAliasElement element; - TypeAliasElement2 get element2 => element.asElement2 as TypeAliasElement2; + TypeAliasElement2 get element2 => element.asElement2; Typedef(this.element, super.library, super.packageGraph); diff --git a/pubspec.yaml b/pubspec.yaml index 528faf3e4c..1f6011578c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: ^3.6.0 dependencies: - analyzer: ^6.10.0 + analyzer: ^7.2.0 args: ^2.4.1 collection: ^1.17.0 crypto: ^3.0.3 diff --git a/tool/mustachio/codegen_runtime_renderer.dart b/tool/mustachio/codegen_runtime_renderer.dart index b51910451a..3910b7a7fd 100644 --- a/tool/mustachio/codegen_runtime_renderer.dart +++ b/tool/mustachio/codegen_runtime_renderer.dart @@ -131,7 +131,7 @@ import '${path.basename(_sourceUri.path)}'; /// Adds type specified in [spec] to the [_typesToProcess] queue, as well as /// all supertypes, and the types of all valid getters, recursively. void _addTypesForRendererSpec(RendererSpec spec) { - var element = spec.contextElement.asElement as InterfaceElement; + var element = spec.contextElement.asElement; var rendererInfo = _RendererInfo(element, public: _rendererClassesArePublic, publicApiFunctionName: spec.name); _typesToProcess.add(rendererInfo); diff --git a/tool/task.dart b/tool/task.dart index e0a843c473..f001b4dd23 100644 --- a/tool/task.dart +++ b/tool/task.dart @@ -862,7 +862,7 @@ Rebuild them with "dart tool/task.dart build" and check the results in. bool get _analyzerInUseIsTarget { // TODO(srawlins): Add validation that this number falls within the // constraints of the analyzer package which are set in `pubspec.yaml`. - const analyzerTarget = '6.11.0'; + const analyzerTarget = '7.2.0'; var lockfilePath = path.join(Directory.current.path, 'pubspec.lock'); var lockfile = loadYaml(File(lockfilePath).readAsStringSync()) as YamlMap;