| library /*isNonNullableByDefault*/; |
| import self as self; |
| import "dart:core" as core; |
| import "dart:_internal" as _in; |
| |
| static method main() → void { |
| self::testNullableUninitializedNonFinalLocal(); |
| self::testNonNullableUninitializedNonFinalLocal(); |
| self::testNullableUninitializedFinalLocal(); |
| self::testNonNullableUninitializedFinalLocal(); |
| self::testNullableInitializedNonFinalLocal(); |
| self::testNonNullableInitializedNonFinalLocal(); |
| self::testNullableInitializedFinalLocal(); |
| self::testNonNullableInitializedFinalLocal(); |
| } |
| static method testNullableUninitializedNonFinalLocal() → void { |
| late core::int? x; |
| x = 42; |
| core::print(x{core::int}); |
| } |
| static method testNonNullableUninitializedNonFinalLocal() → void { |
| late core::int x; |
| x = 42; |
| core::print(x); |
| } |
| static method testNullableUninitializedFinalLocal() → void { |
| late final core::int? x; |
| x = 42; |
| core::print(x{core::int}); |
| } |
| static method testNonNullableUninitializedFinalLocal() → void { |
| late final core::int x; |
| x = 42; |
| core::print(x); |
| } |
| static method testNullableInitializedNonFinalLocal() → void { |
| lowered core::int? #x = _in::createSentinel<core::int?>(); |
| function #x#get() → core::int? |
| return let final core::int? #t1 = #x in _in::isSentinel(#t1) ?{core::int?} #x = 1.{core::int::unary-}(){() → core::int} : #t1{core::int?}; |
| function #x#set(core::int? #t2) → dynamic |
| return #x = #t2; |
| core::print(#x#get(){() → core::int?}); |
| #x#set(42){(core::int?) → dynamic}; |
| core::print(#x#get(){() → core::int?}); |
| lowered core::int? #y = _in::createSentinel<core::int?>(); |
| function #y#get() → core::int? |
| return let final core::int? #t3 = #y in _in::isSentinel(#t3) ?{core::int?} #y = null : #t3{core::int?}; |
| function #y#set(core::int? #t4) → dynamic |
| return #y = #t4; |
| core::print(#y#get(){() → core::int?}); |
| #y#set(42){(core::int?) → dynamic}; |
| core::print(#y#get(){() → core::int?}); |
| } |
| static method testNonNullableInitializedNonFinalLocal() → void { |
| lowered core::int? #x = _in::createSentinel<core::int>(); |
| function #x#get() → core::int |
| return let final core::int? #t5 = #x in _in::isSentinel(#t5) ?{core::int} #x = 1.{core::int::unary-}(){() → core::int} : #t5{core::int}; |
| function #x#set(core::int #t6) → dynamic |
| return #x = #t6; |
| core::print(#x#get(){() → core::int}); |
| #x#set(42){(core::int) → dynamic}; |
| core::print(#x#get(){() → core::int}); |
| } |
| static method testNullableInitializedFinalLocal() → void { |
| lowered final core::int? #x = _in::createSentinel<core::int?>(); |
| function #x#get() → core::int? |
| return let final core::int? #t7 = #x in _in::isSentinel(#t7) ?{core::int?} let final core::int? #t8 = 1.{core::int::unary-}(){() → core::int} in _in::isSentinel(#x) ?{core::int?} #x = #t8 : throw new _in::LateError::localADI("x") : #t7; |
| core::print(#x#get(){() → core::int?}); |
| lowered final core::int? #y = _in::createSentinel<core::int?>(); |
| function #y#get() → core::int? |
| return let final core::int? #t9 = #y in _in::isSentinel(#t9) ?{core::int?} let final core::int? #t10 = null in _in::isSentinel(#y) ?{core::int?} #y = #t10 : throw new _in::LateError::localADI("y") : #t9; |
| core::print(#y#get(){() → core::int?}); |
| } |
| static method testNonNullableInitializedFinalLocal() → void { |
| lowered final core::int? #x = _in::createSentinel<core::int>(); |
| function #x#get() → core::int |
| return let final core::int #t11 = #x in _in::isSentinel(#t11) ?{core::int} let final core::int #t12 = 1.{core::int::unary-}(){() → core::int} in _in::isSentinel(#x) ?{core::int} #x = #t12 : throw new _in::LateError::localADI("x") : #t11; |
| core::print(#x#get(){() → core::int}); |
| } |