Files
sdk/pkg/front_end/testcases/nnbd/issue40945.dart.weak.expect
T
Johnni Winther 061d714971 [cfe] Add test for issue 40945
This has been fixed for some time. Adding a test to verify.

Closes #40945

Change-Id: I7ce93c7c1b8cd054bb57a1923aa8a3f98a9ad7db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177606
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-01-06 09:07:00 +00:00

29 lines
837 B
Plaintext

library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue40945.dart:7:15: Error: The type 'dynamic' of the getter 'C.test' is not a subtype of the type 'int' of the setter 'C.test'.
// dynamic get test => 3.14;
// ^^^^
// pkg/front_end/testcases/nnbd/issue40945.dart:6:12: Context: This is the declaration of the setter 'C.test'.
// void set test(int v) {}
// ^^^^
//
import self as self;
import "dart:core" as core;
class C extends core::Object {
synthetic constructor •() → self::C
: super core::Object::•()
;
set test(core::int v) → void {}
get test() → dynamic
return 3.14;
}
static method test() → dynamic {
self::C c = new self::C::•();
c.{self::C::test} = 1;
c.{self::C::test};
}
static method main() → dynamic {}