| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable. |
| // - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'. |
| // FutureOr<AAlias> foLegacyNonNullable = null; // error |
| // ^ |
| // |
| // pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable. |
| // - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'. |
| // FutureOr<AAliasNonNullable> foNonNullable = null; // error |
| // ^ |
| // |
| import self as self; |
| import "issue41501_lib.dart" as opt; |
| |
| import "dart:async"; |
| import "org-dartlang-testcase:///issue41501_lib.dart"; |
| |
| typedef AAliasNonNullable = opt::A; |
| typedef AAliasNullable = opt::A?; |
| static method test() → dynamic { |
| FutureOr<() → opt::A*>foLegacyNonNullable = let final Never #t1 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:13:42: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A Function()>' because 'FutureOr<A Function()>' is not nullable. |
| - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'. |
| FutureOr<AAlias> foLegacyNonNullable = null; // error |
| ^" in let Null #t2 = null in #t2 == null ?{FutureOr<() → opt::A*>} #t2 as{TypeError,ForNonNullableByDefault} FutureOr<() → opt::A*> : #t2{FutureOr<() → opt::A*>}; |
| FutureOr<() →? opt::A*>foLegacyNullable = null; |
| FutureOr<opt::A>foNonNullable = let final Never #t3 = invalid-expression "pkg/front_end/testcases/nonfunction_type_aliases/issue41501.dart:15:47: Error: The value 'null' can't be assigned to a variable of type 'FutureOr<A>' because 'FutureOr<A>' is not nullable. |
| - 'A' is from 'pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart'. |
| FutureOr<AAliasNonNullable> foNonNullable = null; // error |
| ^" in let Null #t4 = null in #t4 == null ?{FutureOr<opt::A>} #t4 as{TypeError,ForNonNullableByDefault} FutureOr<opt::A> : #t4{FutureOr<opt::A>}; |
| FutureOr<opt::A?>foNullable = null; |
| FutureOr<opt::A?>foNonNullableNullable = null; |
| FutureOr<opt::A?>foNullableNullable = null; |
| } |
| static method main() → dynamic {} |
| |
| library opted_out_lib; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nonfunction_type_aliases/issue41501_lib.dart:5:1: Error: A library can't opt out of null safety by default, when using sound null safety. |
| // // @dart=2.6 |
| // ^^^^^^^^^^^^ |
| // |
| import self as opt; |
| import "dart:core" as core; |
| |
| import "dart:async"; |
| import "org-dartlang-testcase:///issue41501.dart"; |
| |
| typedef AAlias = () →* opt::A*; |
| class A extends core::Object { |
| synthetic constructor •() → opt::A* |
| : super core::Object::•() |
| ; |
| abstract member-signature get _identityHashCode() → core::int*; -> core::Object::_identityHashCode |
| abstract member-signature method _instanceOf(dynamic instantiatorTypeArguments, dynamic functionTypeArguments, dynamic type) → core::bool*; -> core::Object::_instanceOf |
| abstract member-signature method _simpleInstanceOf(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOf |
| abstract member-signature method _simpleInstanceOfTrue(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfTrue |
| abstract member-signature method _simpleInstanceOfFalse(dynamic type) → core::bool*; -> core::Object::_simpleInstanceOfFalse |
| abstract member-signature operator ==(dynamic other) → core::bool*; -> core::Object::== |
| abstract member-signature get hashCode() → core::int*; -> core::Object::hashCode |
| abstract member-signature method toString() → core::String*; -> core::Object::toString |
| abstract member-signature method noSuchMethod(core::Invocation* invocation) → dynamic; -> core::Object::noSuchMethod |
| abstract member-signature get runtimeType() → core::Type*; -> core::Object::runtimeType |
| } |
| static method test() → dynamic { |
| FutureOr<() →* opt::A*>* foLegacy = null; |
| FutureOr<opt::A*>* foNonNullable = null; |
| FutureOr<opt::A*>* foNullable = null; |
| } |
| |
| |
| Extra constant evaluation status: |
| Evaluated: EqualsNull @ org-dartlang-testcase:///issue41501.dart:13:42 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///issue41501.dart:13:42 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///issue41501.dart:13:42 -> NullConstant(null) |
| Evaluated: EqualsNull @ org-dartlang-testcase:///issue41501.dart:15:47 -> BoolConstant(true) |
| Evaluated: VariableGet @ org-dartlang-testcase:///issue41501.dart:15:47 -> NullConstant(null) |
| Evaluated: VariableGet @ org-dartlang-testcase:///issue41501.dart:15:47 -> NullConstant(null) |
| Extra constant evaluation: evaluated: 14, effectively constant: 6 |