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>
33 lines
1.0 KiB
Plaintext
33 lines
1.0 KiB
Plaintext
library /*isNonNullableByDefault*/;
|
|
//
|
|
// Problems in library:
|
|
//
|
|
// pkg/front_end/testcases/nnbd_mixed/issue42181.dart:10:9: Error: The value 'null' can't be assigned to a variable of type 'int Function(int)' because 'int Function(int)' is not nullable.
|
|
// F f = null; // Static error
|
|
// ^
|
|
//
|
|
import self as self;
|
|
import "dart:core" as core;
|
|
|
|
import "org-dartlang-testcase:///issue42181_lib.dart";
|
|
|
|
static method f1(core::int x) → core::int?
|
|
return x;
|
|
static method test() → void {
|
|
(core::int*) → core::int* f = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nnbd_mixed/issue42181.dart:10:9: Error: The value 'null' can't be assigned to a variable of type 'int Function(int)' because 'int Function(int)' is not nullable.
|
|
F f = null; // Static error
|
|
^" in null as{TypeError,ForNonNullableByDefault} (core::int*) → core::int*;
|
|
f = #C1;
|
|
}
|
|
static method main() → dynamic {}
|
|
|
|
library;
|
|
import self as self2;
|
|
import "dart:core" as core;
|
|
|
|
typedef F = (core::int*) →* core::int*;
|
|
|
|
constants {
|
|
#C1 = tearoff self::f1
|
|
}
|