Files
sdk/pkg/front_end/testcases/nnbd/issue_39286_2.dart.weak.expect
T
Jens Johansen 4dcf24ac7f [CFE] Use BlockExpression for encoding cascades
Change-Id: I9c56cbed9880716af804c80c6ca34578ae6765a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148528
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Sigurd Meldgaard <sigurdm@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-05-26 09:07:25 +00:00

46 lines
1.3 KiB
Plaintext

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::•());
}