Elements. Deprecate TypeAliasElement.aliasedElement
Change-Id: I6271efcc69fc891b41f605dd4f1398e5163b579d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/454662 Commit-Queue: Konstantin Shcheglov <scheglov@google.com> Reviewed-by: Paul Berry <paulberry@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
committed by
Commit Queue
parent
975b92de9a
commit
5be8fcc1d5
@@ -1,6 +1,6 @@
|
||||
name: analysis_server_plugin
|
||||
description: A framework and support code for building plugins for the analysis server.
|
||||
version: 0.3.2
|
||||
version: 0.3.3-dev
|
||||
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analysis_server_plugin
|
||||
|
||||
environment:
|
||||
@@ -12,7 +12,7 @@ dependencies:
|
||||
# See the release policy for managing this dependency at
|
||||
# pkg/analyzer/doc/implementation/releasing.md.
|
||||
analyzer: 8.4.0-dev
|
||||
analyzer_plugin: 0.13.9
|
||||
analyzer_plugin: 0.13.10-dev
|
||||
meta: ^1.16.0
|
||||
yaml: ^3.1.0
|
||||
yaml_edit: ^2.2.0
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
## 8.4.0-dev
|
||||
* Add the `experimental_member_use` warning, which warns about any reference to
|
||||
a declaration annotated with `@experimental`.
|
||||
* Deprecate `TypeAliasElement.aliasedElement`, use `aliasedType` instead.
|
||||
|
||||
## 8.3.0
|
||||
* Deprecate `TypeDefiningElement`, check for specific elements.
|
||||
|
||||
@@ -4161,7 +4161,7 @@ package:analyzer/dart/element/element.dart:
|
||||
previousFragment (getter: TopLevelVariableFragment?)
|
||||
TypeAliasElement (class extends Object implements TypeParameterizedElement, TypeDefiningElement):
|
||||
new (constructor: TypeAliasElement Function())
|
||||
aliasedElement (getter: Element?)
|
||||
aliasedElement (getter: Element?, deprecated)
|
||||
aliasedElement2 (getter: Element?, deprecated)
|
||||
aliasedType (getter: DartType)
|
||||
enclosingElement (getter: LibraryElement)
|
||||
|
||||
@@ -3902,6 +3902,7 @@ abstract class TypeAliasElement
|
||||
/// For example, it could be [GenericFunctionTypeElement].
|
||||
///
|
||||
/// If there is no structure, return `null`.
|
||||
@Deprecated('Use aliasedType instead')
|
||||
Element? get aliasedElement;
|
||||
|
||||
/// If the aliased type has structure, return the corresponding element.
|
||||
|
||||
@@ -10454,6 +10454,7 @@ class TypeAliasElementImpl extends ElementImpl
|
||||
_firstFragment.element = this;
|
||||
}
|
||||
|
||||
@Deprecated('Use aliasedType instead')
|
||||
@override
|
||||
@trackedIncludedInId
|
||||
ElementImpl? get aliasedElement {
|
||||
|
||||
@@ -272,12 +272,11 @@ void foo() {}
|
||||
expect(node.name.lexeme, 'foo');
|
||||
}
|
||||
|
||||
test_genericFunctionTypeElement() async {
|
||||
test_genericFunctionTypeFragment() async {
|
||||
await resolveTestCode(r'''
|
||||
typedef F = void Function();
|
||||
void f(void Function() x) {}
|
||||
''');
|
||||
var typeAlias = findElement2.typeAlias('F');
|
||||
var fragment = typeAlias.aliasedElement!.firstFragment;
|
||||
var fragment = findNode.singleGenericFunctionType.declaredFragment!;
|
||||
var result = await getFragmentDeclaration(fragment);
|
||||
expect(result, isNull);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
import 'package:analyzer/dart/element/element.dart';
|
||||
import 'package:analyzer/dart/element/type.dart';
|
||||
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
|
||||
import 'package:analyzer/src/error/codes.dart';
|
||||
import 'package:test/test.dart';
|
||||
@@ -319,7 +319,7 @@ typedef F<T extends A> = B Function<U extends B>(T a, U b);
|
||||
expect(t.name, 'T');
|
||||
assertType(t.bound, 'A');
|
||||
|
||||
var ff = f.aliasedElement as GenericFunctionTypeElement;
|
||||
var ff = f.aliasedType as FunctionType;
|
||||
expect(ff.typeParameters, hasLength(1));
|
||||
|
||||
var u = ff.typeParameters[0];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: analyzer_plugin
|
||||
description: A framework and support code for building plugins for the analysis server.
|
||||
version: 0.13.9
|
||||
version: 0.13.10-dev
|
||||
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer_plugin
|
||||
|
||||
environment:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: analyzer_testing
|
||||
description: Testing utilities related to the analyzer and analysis_server_plugin packages.
|
||||
version: 0.1.4
|
||||
version: 0.1.5-dev
|
||||
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer_testing
|
||||
|
||||
environment:
|
||||
|
||||
Reference in New Issue
Block a user