Files
sdk/pkg/front_end/testcases/nnbd/nullable_param.dart.strong.transformed.expect
T
Jens Johansen d1a6dcfd1f [CFE] Change wording from 'successes' to 'effectively constant'
Change-Id: Ie498a4481bc647a564aaedb20998b8a728337a37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/165561
Auto-Submit: Jens Johansen <jensj@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-10-01 08:46:12 +00:00

29 lines
1.0 KiB
Plaintext

library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
class Foo extends core::Object {
field core::int? field = null;
synthetic constructor •() → self::Foo
: super core::Object::•()
;
method bar(core::int? x) → core::int? {}
}
static method main() → dynamic {
self::Foo foo = new self::Foo::•();
foo.{self::Foo::field} = 5;
foo.{self::Foo::bar}(6);
self::test_nullable_function_type_formal_param(f: () → core::int => 2);
}
static method test_nullable_function_type_formal_param({() →? core::int f = #C1}) → core::int {
return let final core::int? #t1 = let final () →? core::int #t2 = f in #t2.{core::Object::==}(null) ?{core::int?} null : #t2{() → core::int}.call() in #t1.{core::num::==}(null) ?{core::int} 1.{core::int::unary-}() : #t1{core::int};
}
constants {
#C1 = null
}
Extra constant evaluation status:
Evaluated: MethodInvocation @ org-dartlang-testcase:///nullable_param.dart:19:23 -> IntConstant(-1)
Extra constant evaluation: evaluated: 20, effectively constant: 1