@@ -538,6 +538,68 @@ ImplicitCallReference
538
538
staticType: C
539
539
staticElement: self::@class::C::@method::call
540
540
staticType: void Function(int)
541
+ ''' );
542
+ }
543
+
544
+ test_simpleIdentifier_typeAlias () async {
545
+ await assertNoErrorsInCode ('''
546
+ class A {
547
+ void call() {}
548
+ }
549
+ typedef B = A;
550
+ Function f(B b) => b;
551
+ ''' );
552
+
553
+ final node = findNode.implicitCallReference ('b;' );
554
+ assertResolvedNodeText (node, r'''
555
+ ImplicitCallReference
556
+ expression: SimpleIdentifier
557
+ token: b
558
+ staticElement: self::@function::f::@parameter::b
559
+ staticType: A
560
+ alias: self::@typeAlias::B
561
+ staticElement: self::@class::A::@method::call
562
+ staticType: void Function()
563
+ ''' );
564
+ }
565
+
566
+ test_simpleIdentifier_typeVariable () async {
567
+ await assertNoErrorsInCode ('''
568
+ class A {
569
+ void call() {}
570
+ }
571
+ Function f<X extends A>(X x) => x;
572
+ ''' );
573
+
574
+ final node = findNode.implicitCallReference ('x;' );
575
+ assertResolvedNodeText (node, r'''
576
+ ImplicitCallReference
577
+ expression: SimpleIdentifier
578
+ token: x
579
+ staticElement: self::@function::f::@parameter::x
580
+ staticType: X
581
+ staticElement: self::@class::A::@method::call
582
+ staticType: void Function()
583
+ ''' );
584
+ }
585
+
586
+ test_simpleIdentifier_typeVariable2 () async {
587
+ await assertNoErrorsInCode ('''
588
+ class A {
589
+ void call() {}
590
+ }
591
+ Function f<X extends A, Y extends X>(Y y) => y;
592
+ ''' );
593
+
594
+ final node = findNode.implicitCallReference ('y;' );
595
+ assertResolvedNodeText (node, r'''
596
+ ImplicitCallReference
597
+ expression: SimpleIdentifier
598
+ token: y
599
+ staticElement: self::@function::f::@parameter::y
600
+ staticType: Y
601
+ staticElement: self::@class::A::@method::call
602
+ staticType: void Function()
541
603
''' );
542
604
}
543
605
}
0 commit comments