c191551fac
TEST=Covered by existing tests. Change-Id: Ied8be1874164e68e0a3a48e1b2f9a33310071381 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183009 Commit-Queue: Dmitry Stefantsov <dmitryas@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
49 lines
2.0 KiB
Plaintext
49 lines
2.0 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/late_lowering/compound.dart:20:3: Error: Late variable 'local' without initializer is definitely unassigned.
|
|
// local += 0;
|
|
// ^^^^^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
import "dart:_internal" as _in;
|
|
|
|
static method main() → dynamic {
|
|
lowered core::int? #local1;
|
|
function #local1#get() → core::int
|
|
return let final core::int? #t1 = #local1 in #t1.==(null) ?{core::int} throw new _in::LateError::localNI("local1") : #t1{core::int};
|
|
function #local1#set(core::int #t2) → dynamic
|
|
return #local1 = #t2;
|
|
#local1#set.call(0);
|
|
self::expect(0, #local1#get.call());
|
|
#local1#set.call(#local1#get.call().{core::num::+}(2));
|
|
self::expect(2, #local1#get.call());
|
|
lowered core::int? #local2;
|
|
function #local2#get() → core::int
|
|
return let final core::int? #t3 = #local2 in #t3.==(null) ?{core::int} #local2 = 1 : #t3{core::int};
|
|
function #local2#set(core::int #t4) → dynamic
|
|
return #local2 = #t4;
|
|
self::expect(1, #local2#get.call());
|
|
#local2#set.call(#local2#get.call().{core::num::+}(2));
|
|
self::expect(3, #local2#get.call());
|
|
}
|
|
static method error() → dynamic {
|
|
lowered final core::int? #local;
|
|
function #local#get() → core::int
|
|
return let final core::int? #t5 = #local in #t5.==(null) ?{core::int} throw new _in::LateError::localNI("local") : #t5{core::int};
|
|
function #local#set(core::int #t6) → dynamic
|
|
if(#local.==(null))
|
|
return #local = #t6;
|
|
else
|
|
throw new _in::LateError::localAI("local");
|
|
#local#set.call((let final Never #t7 = invalid-expression "pkg/front_end/testcases/late_lowering/compound.dart:20:3: Error: Late variable 'local' without initializer is definitely unassigned.
|
|
local += 0;
|
|
^^^^^" in #local#get.call()).{core::num::+}(0));
|
|
}
|
|
static method expect(dynamic expected, dynamic actual) → dynamic {
|
|
if(!expected.{core::Object::==}(actual))
|
|
throw "Expected ${expected}, actual ${actual}";
|
|
}
|