c191551fac
TEST=Covered by existing tests. Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
42 lines
1.6 KiB
Plaintext
42 lines
1.6 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41495.dart:14:6: Error: Property 'c1' cannot be accessed on 'A?' because it is potentially null.
|
|
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue41495.dart'.
|
|
// Try accessing using ?. instead.
|
|
// a1.c1;
|
|
// ^^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/issue41495.dart:15:6: Error: Property 'test' cannot be accessed on 'A?' because it is potentially null.
|
|
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue41495.dart'.
|
|
// Try accessing using ?. instead.
|
|
// a1.test;
|
|
// ^^^^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class A extends core::Object {
|
|
field core::int c1 = 1;
|
|
synthetic constructor •() → self::A
|
|
: super core::Object::•()
|
|
;
|
|
method test() → core::int
|
|
return 2;
|
|
}
|
|
static method main() → dynamic {}
|
|
static method errors() → dynamic {
|
|
self::A? a1 = new self::A::•() as{ForNonNullableByDefault} self::A?;
|
|
let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/issue41495.dart:14:6: Error: Property 'c1' cannot be accessed on 'A?' because it is potentially null.
|
|
- 'A' is from 'pkg/front_end/testcases/nnbd/issue41495.dart'.
|
|
Try accessing using ?. instead.
|
|
a1.c1;
|
|
^^" in a1.{self::A::c1};
|
|
let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/issue41495.dart:15:6: Error: Property 'test' cannot be accessed on 'A?' because it is potentially null.
|
|
- 'A' is from 'pkg/front_end/testcases/nnbd/issue41495.dart'.
|
|
Try accessing using ?. instead.
|
|
a1.test;
|
|
^^^^" in a1.{self::A::test};
|
|
}
|