Files
sdk/pkg/front_end/testcases/nnbd/nullable_param.dart.weak.expect
T
Johnni Winther 36641368bb [cfe] Treat NonNullableByDefault as default in ast-to-text
This changes ast-to-text to mark legacy libraries instead of
non-nullable-by-default libraries.

TEST=existing

Change-Id: Ib01147e4ef48c2c5b2ffc6b23547998344dfdf2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307121
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2023-06-08 06:28:50 +00:00

25 lines
887 B
Plaintext

library;
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){(core::int?) → core::int?};
self::test_nullable_function_type_formal_param(f: () → core::int => 2);
}
static method test_nullable_function_type_formal_param({has-declared-initializer () →? core::int f = #C1}) → core::int {
return let final core::int? #t1 = let final () →? core::int #t2 = f in #t2 == null ?{core::int?} null : #t2{() → core::int}(){() → core::int} in #t1 == null ?{core::int} 1.{core::int::unary-}(){() → core::int} : #t1{core::int};
}
constants {
#C1 = null
}