blob: c69ecec3c2c2229c2370645b51ab0ec43d887ada [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
// - 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
// Try accessing using ?. instead.
// a.foo ??= x; // Error.
// ^^^
//
// pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
// Try accessing using ?. instead.
// t.foo ??= x; // Error.
// ^^^
//
// pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
// - 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
// Try accessing using ?. instead.
// b.fooExtension ??= x; // Error.
// ^^^^^^^^^^^^
//
// pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
// Try accessing using ?. instead.
// t.fooExtension ??= x; // Error.
// ^^^^^^^^^^^^
//
import self as self;
import "dart:core" as core;
class A extends core::Object {
field core::int? foo = null;
field self::A bar;
constructor •(self::A bar) self::A
: self::A::bar = bar, super core::Object::•()
;
}
class B extends core::Object {
synthetic constructor •() self::B
: super core::Object::•()
;
}
extension Extension on self::B {
get fooExtension = self::Extension|get#fooExtension;
get barExtension = self::Extension|get#barExtension;
set fooExtension = self::Extension|set#fooExtension;
}
static method test<T extends self::A?>(self::A? a, self::test::T% t, dynamic d, core::int x) dynamic {
let final self::A? #t1 = a in invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
- 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
Try accessing using ?. instead.
a.foo ??= x; // Error.
^^^" in #t1.{self::A::foo}{<nullable>}.{core::int?} == null ?{core::int} invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:13:5: Error: Property 'foo' cannot be accessed on 'A?' because it is potentially null.
- 'A' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
Try accessing using ?. instead.
a.foo ??= x; // Error.
^^^" in #t1.{self::A::foo}{<nullable>}. = x : null;
let final self::test::T% #t2 = t in invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
Try accessing using ?. instead.
t.foo ??= x; // Error.
^^^" in #t2.{self::A::foo}{<nullable>}.{core::int?} == null ?{core::int} invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:14:5: Error: Property 'foo' cannot be accessed on 'T' because it is potentially null.
Try accessing using ?. instead.
t.foo ??= x; // Error.
^^^" in #t2.{self::A::foo}{<nullable>}. = x : null;
let final dynamic #t3 = d in #t3{dynamic}.foo == null ?{dynamic} #t3{dynamic}.foo = x : null;
let final self::A? #t4 = a in #t4 == null ?{core::int?} null : let final self::A #t5 = #t4{self::A}.{self::A::bar}{self::A} in #t5.{self::A::foo}{core::int?} == null ?{core::int} #t5.{self::A::foo} = x : null;
}
static method Extension|get#fooExtension(lowered final self::B #this) → core::int?
return null;
static method Extension|set#fooExtension(lowered final self::B #this, core::int? value) → void {}
static method Extension|get#barExtension(lowered final self::B #this) → self::B
return new self::B::•();
static method testExtension<T extends self::B?>(self::B? b, self::testExtension::T% t, core::int x) → dynamic {
let final self::B? #t6 = b in invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
- 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
Try accessing using ?. instead.
b.fooExtension ??= x; // Error.
^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t6) == null ?{core::int} invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:28:5: Error: Property 'fooExtension' cannot be accessed on 'B?' because it is potentially null.
- 'B' is from 'pkg/front_end/testcases/nnbd/issue43278.dart'.
Try accessing using ?. instead.
b.fooExtension ??= x; // Error.
^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t6, x) : null;
let final self::testExtension::T% #t7 = t in invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
Try accessing using ?. instead.
t.fooExtension ??= x; // Error.
^^^^^^^^^^^^" in self::Extension|get#fooExtension(#t7) == null ?{core::int} invalid-expression "pkg/front_end/testcases/nnbd/issue43278.dart:29:5: Error: Property 'fooExtension' cannot be accessed on 'T' because it is potentially null.
Try accessing using ?. instead.
t.fooExtension ??= x; // Error.
^^^^^^^^^^^^" in self::Extension|set#fooExtension(#t7, x) : null;
let final self::B? #t8 = b in #t8 == null ?{core::int?} null : let final self::B #t9 = self::Extension|get#barExtension(#t8{self::B}) in self::Extension|get#fooExtension(#t9) == null ?{core::int} self::Extension|set#fooExtension(#t9, x) : null;
}
static method main() → dynamic {}