dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.22k stars 1.57k forks source link

MISMATCHED_GETTER_AND_SETTER_TYPES is reported multiple times #34745

Open scheglov opened 6 years ago

scheglov commented 6 years ago

For example, this test fails. We should report an error for B, but not for X.

  test_error_mismatchedGetterAndSetterTypes_OK_alreadyReported_super() async {
    newFile('/test/lib/a.dart', content: r'''
class A {
  int get foo => 0;
}

class B extends A {
  set foo(String _) {}
}
''');
    addTestFile(r'''
import 'a.dart';

class X extends B {}
''');
    await resolveTestFile();
    assertNoTestErrors();
  }
srawlins commented 4 years ago

Note that the codes are now GETTER_NOT_ASSIGNABLE_SETTER_TYPES and GETTER_NOT_SUBTYPE_SETTER_TYPES.

srawlins commented 2 years ago

Very similar to https://github.com/dart-lang/sdk/issues/26224