File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -317,6 +317,7 @@ class _TypeVisitor extends RecursiveElementVisitor<void> {
317
317
318
318
@override
319
319
void visitTypeAliasElement (TypeAliasElement element) {
320
+ _addType (element.aliasedType);
320
321
_elements.add (element);
321
322
super .visitTypeAliasElement (element);
322
323
}
Original file line number Diff line number Diff line change @@ -3583,18 +3583,21 @@ void main() {
3583
3583
expect (mocksContent, contains ('implements _i2.Baz' ));
3584
3584
});
3585
3585
3586
- test ('when a type parameter is a typedef a function' , () async {
3586
+ test (
3587
+ 'when a type parameter is a typedef a function which returns another type' ,
3588
+ () async {
3587
3589
final mocksContent = await buildWithNonNullable ({
3588
3590
...annotationsAsset,
3589
3591
'foo|lib/foo.dart' : dedent (r'''
3590
- typedef CreateInt = int Function();
3592
+ class Bar {}
3593
+ typedef CreateBar = Bar Function();
3591
3594
3592
3595
class BaseFoo<T> {
3593
3596
BaseFoo(this.t);
3594
3597
final T t;
3595
3598
}
3596
3599
3597
- class Foo extends BaseFoo<CreateInt > {
3600
+ class Foo extends BaseFoo<CreateBar > {
3598
3601
Foo() : super(() => 1);
3599
3602
}
3600
3603
''' ),
You can’t perform that action at this time.
0 commit comments