blob: b21ab32d60068b84d83736938be84c98afe7e774 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue_39286_2.dart:15:14: Warning: Operand of null-aware operation '!' has type 'String' which excludes null.
// x..f()!.g()['Hi!']!..h()!.y = 2;
// ^
//
// pkg/front_end/testcases/nnbd/issue_39286_2.dart:15:24: Warning: Operand of null-aware operation '!' has type 'C' which excludes null.
// - 'C' is from 'pkg/front_end/testcases/nnbd/issue_39286_2.dart'.
// x..f()!.g()['Hi!']!..h()!.y = 2;
// ^
//
import self as self;
import "dart:core" as core;
class C extends core::Object {
field core::int y = 42;
synthetic constructor •() self::C
: super core::Object::•()
;
method f() self::D?
return new self::D::•();
method h() self::C
return this;
}
class D extends core::Object {
synthetic constructor •() self::D
: super core::Object::•()
;
method g() self::D
return this;
operator [](core::String s) core::String {
return "!${s}!";
}
}
static method test(self::C x) void {
let final self::C #t1 = x in block {
#t1.{self::C::f}()!.{self::D::g}().{self::D::[]}("Hi!")!;
#t1.{self::C::h}()!.{self::C::y} = 2;
} =>#t1;
}
static method main() dynamic {
self::test(new self::C::•());
}