Skip to content

Commit dbff41c

Browse files
bwilkersoncommit-bot@chromium.org
authored andcommitted
Add failing test for issue 43667
Change-Id: I5ad0f6d67a99003ca847fe6fbad1db88d24f246c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165981 Reviewed-by: Konstantin Shcheglov <scheglov@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
1 parent 8967e3b commit dbff41c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

pkg/analysis_server/test/src/services/correction/fix/create_missing_overrides_test.dart

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,35 @@ class B extends A {
478478
''');
479479
}
480480

481+
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/43667')
482+
Future<void> test_method_withTypedef() async {
483+
// This fails because the element representing `Base.closure` has a return
484+
// type that has forgotten that it was declared using the typedef `Closure`.
485+
await resolveTestUnit('''
486+
typedef Closure = T Function<T>(T input);
487+
488+
abstract class Base {
489+
Closure closure();
490+
}
491+
492+
class Concrete extends Base {}
493+
''');
494+
await assertHasFix('''
495+
typedef Closure = T Function<T>(T input);
496+
497+
abstract class Base {
498+
Closure closure();
499+
}
500+
501+
class Concrete extends Base {
502+
@override
503+
Closure closure() {
504+
// TODO: implement closure
505+
}
506+
}
507+
''');
508+
}
509+
481510
Future<void> test_methods_reverseOrder() async {
482511
await resolveTestUnit('''
483512
abstract class A {

0 commit comments

Comments
 (0)