Skip to content

Commit aa15b91

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Deprecate UriReferencedElement.
Change-Id: Ia74e6ab4ea6935897c0d137d67da9c916e691eca Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418927 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 42394e5 commit aa15b91

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

pkg/analyzer/api.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,6 @@ package:analyzer/dart/element/element.dart:
32273227
TYPE_PARAMETER (static getter: ElementKind)
32283228
UNIVERSE (static getter: ElementKind)
32293229
values (static getter: List<ElementKind>)
3230-
of (static method: ElementKind Function(Element?))
32313230
new (constructor: ElementKind Function(String, int, String))
32323231
displayName (getter: String)
32333232
name (getter: String)
@@ -3522,7 +3521,7 @@ package:analyzer/dart/element/element.dart:
35223521
typeParameters (getter: List<TypeParameterElement>, deprecated)
35233522
UndefinedElement (class extends Object implements Element, deprecated):
35243523
new (constructor: UndefinedElement Function())
3525-
UriReferencedElement (class extends Object implements _ExistingElement):
3524+
UriReferencedElement (class extends Object implements _ExistingElement, deprecated):
35263525
new (constructor: UriReferencedElement Function())
35273526
uri (getter: String?)
35283527
uriEnd (getter: int)
@@ -3538,7 +3537,7 @@ package:analyzer/dart/element/element.dart:
35383537
name (getter: String)
35393538
type (getter: DartType)
35403539
computeConstantValue (method: DartObject? Function())
3541-
_ExistingElement (class extends Object implements Element):
3540+
_ExistingElement (class extends Object implements Element, deprecated):
35423541
new (constructor: _ExistingElement Function())
35433542
declaration (getter: Element, deprecated)
35443543
library (getter: LibraryElement, deprecated)

pkg/analyzer/lib/dart/element/element.dart

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,18 +1000,6 @@ class ElementKind implements Comparable<ElementKind> {
10001000

10011001
@override
10021002
String toString() => name;
1003-
1004-
/// Returns the kind of the given [element], or [ERROR] if the element is
1005-
/// `null`.
1006-
///
1007-
/// This is a utility method that can reduce the need for null checks in
1008-
/// other places.
1009-
static ElementKind of(Element? element) {
1010-
if (element == null) {
1011-
return ERROR;
1012-
}
1013-
return element.kind;
1014-
}
10151003
}
10161004

10171005
/// The location of an element within the element model.
@@ -2318,6 +2306,7 @@ abstract class UndefinedElement implements Element {}
23182306
/// An element included into a library using some URI.
23192307
///
23202308
/// Clients may not extend, implement or mix-in this class.
2309+
@Deprecated('Use Element2 instead')
23212310
abstract class UriReferencedElement implements _ExistingElement {
23222311
/// The URI that is used to include this element into the enclosing library,
23232312
/// or `null` if this is the defining compilation unit of a library.
@@ -2385,6 +2374,7 @@ abstract class VariableElement implements Element, ConstantEvaluationTarget {
23852374

23862375
/// This class exists to provide non-nullable overrides for existing elements,
23872376
/// as opposite to artificial "multiply defined" element.
2377+
@Deprecated('Use Element2 instead')
23882378
@AnalyzerPublicApi(
23892379
message: 'Exposed because it is implemented by various elements')
23902380
abstract class _ExistingElement implements Element {

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11751,9 +11751,10 @@ mixin TypeParameterizedElementMixin on ElementImpl
1175111751
}
1175211752
}
1175311753

11754-
/// A concrete implementation of a [UriReferencedElement].
1175511754
abstract class UriReferencedElementImpl extends _ExistingElementImpl
11756-
implements UriReferencedElement {
11755+
implements
11756+
// ignore:deprecated_member_use_from_same_package
11757+
UriReferencedElement {
1175711758
/// The offset of the URI in the file, or `-1` if this node is synthetic.
1175811759
int _uriOffset = -1;
1175911760

0 commit comments

Comments
 (0)