7
7
/// The only entrypoint for constructing these classes is [ElementType.for_] .
8
8
library ;
9
9
10
- import 'package:analyzer/dart/element/element2 .dart' ;
10
+ import 'package:analyzer/dart/element/element .dart' ;
11
11
import 'package:analyzer/dart/element/nullability_suffix.dart' ;
12
12
import 'package:analyzer/dart/element/type.dart' ;
13
13
import 'package:dartdoc/src/model/comment_referable.dart' ;
@@ -67,7 +67,7 @@ abstract class ElementType with CommentReferable, Nameable {
67
67
String toString () => '$type ' ;
68
68
}
69
69
70
- /// An [ElementType] that isn't pinned to an [Element2 ] (or one that is, but
70
+ /// An [ElementType] that isn't pinned to an [Element ] (or one that is, but
71
71
/// whose element is irrelevant).
72
72
class UndefinedElementType extends ElementType {
73
73
UndefinedElementType ._(super .type, super .library, super .packageGraph)
@@ -102,9 +102,9 @@ class UndefinedElementType extends ElementType {
102
102
// We can not simply throw here because not all SDK libraries resolve
103
103
// all types.
104
104
if (type is InvalidType ) return 'dynamic' ;
105
- assert (const {'Never' }.contains (type.documentableElement2? .name3 ),
105
+ assert (const {'Never' }.contains (type.documentableElement2? .name ),
106
106
'Unrecognized type for UndefinedElementType: $type ' );
107
- return type.documentableElement2! .name3 ! ;
107
+ return type.documentableElement2! .name ! ;
108
108
}
109
109
110
110
@override
@@ -129,7 +129,7 @@ class UndefinedElementType extends ElementType {
129
129
Iterable <CommentReferable >? get referenceGrandparentOverrides => null ;
130
130
}
131
131
132
- /// A [FunctionType] that does not have an underpinning [Element2 ] .
132
+ /// A [FunctionType] that does not have an underpinning [Element ] .
133
133
class FunctionTypeElementType extends UndefinedElementType
134
134
with Rendered , Callable {
135
135
FunctionTypeElementType ._(
@@ -205,10 +205,10 @@ class ParameterizedElementType extends DefinedElementType with Rendered {
205
205
206
206
/// An [ElementType] whose underlying type was referred to by a type alias.
207
207
mixin Aliased implements ElementType {
208
- Element2 get typeAliasElement2 => type.alias! .element2 ;
208
+ Element get typeAliasElement2 => type.alias! .element ;
209
209
210
210
@override
211
- String get name => typeAliasElement2.name3 ! ;
211
+ String get name => typeAliasElement2.name ! ;
212
212
213
213
@override
214
214
bool get isTypedef => true ;
@@ -253,7 +253,7 @@ class TypeParameterElementType extends DefinedElementType {
253
253
String get nameWithGenericsPlain => '$name $nullabilitySuffix ' ;
254
254
}
255
255
256
- /// An [ElementType] associated with an [Element2 ] .
256
+ /// An [ElementType] associated with an [Element ] .
257
257
abstract class DefinedElementType extends ElementType {
258
258
final ModelElement modelElement;
259
259
@@ -263,7 +263,7 @@ abstract class DefinedElementType extends ElementType {
263
263
264
264
factory DefinedElementType ._from (DartType type, ModelElement modelElement,
265
265
Library library, PackageGraph packageGraph) {
266
- if (type is ! TypeAliasElement2 && type.alias != null ) {
266
+ if (type is ! TypeAliasElement && type.alias != null ) {
267
267
// Here, `alias.element` signals that this is a type referring to an
268
268
// alias. (`TypeAliasElement.alias.element` has different implications.
269
269
// In that case it is an actual type alias of some kind (generic or
@@ -288,7 +288,7 @@ abstract class DefinedElementType extends ElementType {
288
288
}
289
289
290
290
@override
291
- String get name => type.documentableElement2! .name3 ! ;
291
+ String get name => type.documentableElement2! .name ! ;
292
292
293
293
@override
294
294
String get fullyQualifiedName => modelElement.fullyQualifiedName;
0 commit comments