Skip to content

Commit 580107f

Browse files
bwilkersonCommit Queue
authored andcommitted
Migrate generic_type_alias.test
Change-Id: Iec8d7e151cfe0da7c94d40f32ce0197ce89b47eb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401541 Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Brian Wilkerson <[email protected]>
1 parent 0a5a8f1 commit 580107f

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10717,6 +10717,8 @@ class TypeAliasElementImpl2 extends TypeDefiningElementImpl2
1071710717
switch (firstFragment.aliasedElement) {
1071810718
case InstanceFragment instance:
1071910719
return instance.element;
10720+
case GenericFunctionTypeFragment instance:
10721+
return instance.element;
1072010722
}
1072110723
return null;
1072210724
}

pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:analyzer/dart/analysis/features.dart';
6-
import 'package:analyzer/dart/element/element.dart';
6+
import 'package:analyzer/dart/element/element2.dart';
77
import 'package:analyzer/src/dart/error/syntactic_errors.dart';
88
import 'package:analyzer/src/error/codes.dart';
99
import 'package:test/test.dart';
@@ -275,18 +275,18 @@ class B {}
275275
276276
typedef F<T extends A> = B Function<U extends B>(T a, U b);
277277
''');
278-
var f = findElement.typeAlias('F');
279-
expect(f.typeParameters, hasLength(1));
278+
var f = findElement2.typeAlias('F');
279+
expect(f.typeParameters2, hasLength(1));
280280

281-
var t = f.typeParameters[0];
282-
expect(t.name, 'T');
281+
var t = f.typeParameters2[0];
282+
expect(t.name3, 'T');
283283
assertType(t.bound, 'A');
284284

285-
var ff = f.aliasedElement as GenericFunctionTypeElement;
286-
expect(ff.typeParameters, hasLength(1));
285+
var ff = f.aliasedElement2 as GenericFunctionTypeElement2;
286+
expect(ff.typeParameters2, hasLength(1));
287287

288-
var u = ff.typeParameters[0];
289-
expect(u.name, 'U');
288+
var u = ff.typeParameters2[0];
289+
expect(u.name3, 'U');
290290
assertType(u.bound, 'B');
291291
}
292292
}

0 commit comments

Comments
 (0)