@@ -31,7 +31,7 @@ abstract class ElementType extends Privacy with CommentReferable, Nameable {
31
31
f.element.kind == ElementKind .DYNAMIC ||
32
32
f.element.kind == ElementKind .NEVER ) {
33
33
if (f is FunctionType ) {
34
- if (f.aliasElement != null ) {
34
+ if (f.alias ? .element != null ) {
35
35
return AliasedFunctionTypeElementType (
36
36
f, library, packageGraph, returnedFrom);
37
37
}
@@ -44,14 +44,14 @@ abstract class ElementType extends Privacy with CommentReferable, Nameable {
44
44
// In that case it is an actual type alias of some kind (generic
45
45
// or otherwise. Here however aliasElement signals that this is a
46
46
// type referring to an alias.
47
- if (f is ! TypeAliasElement && f.aliasElement != null ) {
47
+ if (f is ! TypeAliasElement && f.alias ? .element != null ) {
48
48
return AliasedElementType (
49
49
f, library, packageGraph, element, returnedFrom);
50
50
}
51
51
assert (f is ParameterizedType || f is TypeParameterType );
52
52
// TODO(jcollins-g): strip out all the cruft that's accumulated
53
53
// here for non-generic type aliases.
54
- var isGenericTypeAlias = f.aliasElement != null && f is ! InterfaceType ;
54
+ var isGenericTypeAlias = f.alias ? .element != null && f is ! InterfaceType ;
55
55
if (f is FunctionType ) {
56
56
assert (f is ParameterizedType );
57
57
// This is an indication we have an extremely out of date analyzer....
@@ -188,8 +188,8 @@ class AliasedFunctionTypeElementType extends FunctionTypeElementType
188
188
AliasedFunctionTypeElementType (FunctionType f, Library library,
189
189
PackageGraph packageGraph, ElementType returnedFrom)
190
190
: super (f, library, packageGraph, returnedFrom) {
191
- assert (type.aliasElement != null );
192
- assert (type.aliasArguments != null );
191
+ assert (type.alias ? .element != null );
192
+ assert (type.alias ? .typeArguments != null );
193
193
}
194
194
195
195
@override
@@ -220,18 +220,18 @@ class ParameterizedElementType extends DefinedElementType with Rendered {
220
220
/// A [ElementType] whose underlying type was referrred to by a type alias.
221
221
mixin Aliased implements ElementType {
222
222
@override
223
- String get name => type.aliasElement .name;
223
+ String get name => type.alias.element .name;
224
224
225
225
@override
226
226
bool get isTypedef => true ;
227
227
228
228
ModelElement _aliasElement;
229
229
ModelElement get aliasElement => _aliasElement ?? =
230
- ModelElement .fromElement (type.aliasElement , packageGraph);
230
+ ModelElement .fromElement (type.alias.element , packageGraph);
231
231
232
232
Iterable <ElementType > _aliasArguments;
233
233
Iterable <ElementType > get aliasArguments =>
234
- _aliasArguments ?? = type.aliasArguments
234
+ _aliasArguments ?? = type.alias.typeArguments
235
235
.map ((f) => ElementType .from (f, library, packageGraph))
236
236
.toList (growable: false );
237
237
}
@@ -240,7 +240,7 @@ class AliasedElementType extends ParameterizedElementType with Aliased {
240
240
AliasedElementType (ParameterizedType type, Library library,
241
241
PackageGraph packageGraph, ModelElement element, ElementType returnedFrom)
242
242
: super (type, library, packageGraph, element, returnedFrom) {
243
- assert (type.aliasElement != null );
243
+ assert (type.alias ? .element != null );
244
244
}
245
245
246
246
@override
@@ -429,7 +429,7 @@ class CallableElementType extends DefinedElementType with Rendered, Callable {
429
429
Iterable <ElementType > _typeArguments;
430
430
@override
431
431
Iterable <ElementType > get typeArguments =>
432
- _typeArguments ?? = (type.aliasArguments ?? [])
432
+ _typeArguments ?? = (type.alias ? .typeArguments ?? [])
433
433
.map ((f) => ElementType .from (f, library, packageGraph))
434
434
.toList (growable: false );
435
435
}
0 commit comments