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
1.6 KiB
Plaintext
49 lines
1.6 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd/definite_assignment_and_completion.dart:10:10: Error: Non-nullable variable 'x' must be assigned before it can be used.
|
|
// return x;
|
|
// ^
|
|
//
|
|
// pkg/front_end/testcases/nnbd/definite_assignment_and_completion.dart:28:12: Error: Non-nullable variable 'x' must be assigned before it can be used.
|
|
// return x;
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
class Class extends core::Object /*hasConstConstructor*/ {
|
|
final field core::int x;
|
|
const constructor •(core::int x) → self::Class
|
|
: self::Class::x = x, super core::Object::•()
|
|
;
|
|
method foo() → core::int {
|
|
core::int x;
|
|
return let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd/definite_assignment_and_completion.dart:28:12: Error: Non-nullable variable 'x' must be assigned before it can be used.
|
|
return x;
|
|
^" in x;
|
|
}
|
|
method bar() → core::int
|
|
return 0;
|
|
method baz(core::int x) → core::int {
|
|
return x;
|
|
}
|
|
method boz(core::int x) → core::int
|
|
return x;
|
|
}
|
|
static method foo() → core::int {
|
|
core::int x;
|
|
return let final Never #t2 = invalid-expression "pkg/front_end/testcases/nnbd/definite_assignment_and_completion.dart:10:10: Error: Non-nullable variable 'x' must be assigned before it can be used.
|
|
return x;
|
|
^" in x;
|
|
}
|
|
static method bar() → core::int
|
|
return 0;
|
|
static method baz(core::int x) → core::int {
|
|
return x;
|
|
}
|
|
static method boz(core::int x) → core::int
|
|
return x;
|
|
static method main() → dynamic {}
|