blob: ffb6307abf7f9d89307d73e5bc0086eca364b798 [file] [log] [blame]
library /*isNonNullableByDefault*/;
//
// Problems in library:
//
// pkg/front_end/testcases/nnbd/issue42758.dart:7:17: Warning: Operand of null-aware operation '...?' has type 'Never' which excludes null.
// var l2 = [...?n1];
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:8:16: Error: Can't spread a value with static type 'Never?'.
// var l3 = [...n2];
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:10:16: Error: Can't spread a value with static type 'Null'.
// var l5 = [...n3];
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:13:17: Warning: Operand of null-aware operation '...?' has type 'Never' which excludes null.
// var s2 = {...?n1, n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:14:16: Error: Can't spread a value with static type 'Never?'.
// var s3 = {...n2, n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:16:16: Error: Can't spread a value with static type 'Null'.
// var s5 = {...n3, n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:19:17: Warning: Operand of null-aware operation '...?' has type 'Never' which excludes null.
// var m2 = {...?n1, n1: n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:20:16: Error: Can't spread a value with static type 'Never?'.
// var m3 = {...n2, n1: n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:22:16: Error: Can't spread a value with static type 'Null'.
// var m5 = {...n3, n1: n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:29:17: Warning: Operand of null-aware operation '...?' has type 'N1' which excludes null.
// var l2 = [...?n1];
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:30:16: Error: Can't spread a value with static type 'N2'.
// var l3 = [...n2];
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:32:16: Error: Can't spread a value with static type 'N3'.
// var l5 = [...n3];
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:35:17: Warning: Operand of null-aware operation '...?' has type 'N1' which excludes null.
// var s2 = {...?n1, n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:36:16: Error: Can't spread a value with static type 'N2'.
// var s3 = {...n2, n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:38:16: Error: Can't spread a value with static type 'N3'.
// var s5 = {...n3, n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:41:17: Warning: Operand of null-aware operation '...?' has type 'N1' which excludes null.
// var m2 = {...?n1, n1: n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:42:16: Error: Can't spread a value with static type 'N2'.
// var m3 = {...n2, n1: n1};
// ^
//
// pkg/front_end/testcases/nnbd/issue42758.dart:44:16: Error: Can't spread a value with static type 'N3'.
// var m5 = {...n3, n1: n1};
// ^
//
import self as self;
import "dart:core" as core;
import "dart:_internal" as _in;
import "dart:collection" as col;
static method test1(Never n1, Never? n2, core::Null? n3) → dynamic {
core::List<Never> l1 = block {
final core::List<Never> #t1 = <Never>[];
for (final Never #t2 in let final Never #t3 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."))
#t1.{core::List::add}(#t2);
} =>#t1;
core::List<Never> l2 = block {
final core::List<Never> #t4 = <Never>[];
final core::Iterable<Never>? #t5 = let final Never #t6 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
if(!#t5.{core::Object::==}(null))
for (final Never #t7 in #t5{core::Iterable<Never>})
#t4.{core::List::add}(#t7);
} =>#t4;
core::List<dynamic> l3 = <dynamic>[invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:8:16: Error: Can't spread a value with static type 'Never?'.
var l3 = [...n2];
^"];
core::List<Never> l4 = block {
final core::List<Never> #t8 = <Never>[];
final core::Iterable<Never>? #t9 = n2;
if(!#t9.{core::Object::==}(null))
for (final Never #t10 in #t9{core::Iterable<Never>})
#t8.{core::List::add}(#t10);
} =>#t8;
core::List<dynamic> l5 = <dynamic>[invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:10:16: Error: Can't spread a value with static type 'Null'.
var l5 = [...n3];
^"];
core::List<Never> l6 = block {
final core::List<Never> #t11 = <Never>[];
final core::Iterable<Never>? #t12 = n3;
if(!#t12.{core::Object::==}(null))
for (final Never #t13 in #t12{core::Iterable<Never>})
#t11.{core::List::add}(#t13);
} =>#t11;
core::Set<Never> s1 = block {
final core::Set<Never> #t14 = col::LinkedHashSet::•<Never>();
for (final Never #t15 in let final Never #t16 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."))
#t14.{core::Set::add}(#t15);
#t14.{core::Set::add}(let final Never #t17 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t14;
core::Set<Never> s2 = block {
final core::Set<Never> #t18 = col::LinkedHashSet::•<Never>();
final core::Iterable<Never>? #t19 = let final Never #t20 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
if(!#t19.{core::Object::==}(null))
for (final Never #t21 in #t19{core::Iterable<Never>})
#t18.{core::Set::add}(#t21);
#t18.{core::Set::add}(let final Never #t22 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t18;
core::Set<dynamic> s3 = let final core::Set<dynamic> #t23 = col::LinkedHashSet::•<dynamic>() in let final dynamic #t24 = #t23.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:14:16: Error: Can't spread a value with static type 'Never?'.
var s3 = {...n2, n1};
^") in let final dynamic #t25 = #t23.{core::Set::add}(let final Never #t26 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")) in #t23;
core::Set<Never> s4 = block {
final core::Set<Never> #t27 = col::LinkedHashSet::•<Never>();
final core::Iterable<Never>? #t28 = n2;
if(!#t28.{core::Object::==}(null))
for (final Never #t29 in #t28{core::Iterable<Never>})
#t27.{core::Set::add}(#t29);
#t27.{core::Set::add}(let final Never #t30 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t27;
core::Set<dynamic> s5 = let final core::Set<dynamic> #t31 = col::LinkedHashSet::•<dynamic>() in let final dynamic #t32 = #t31.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:16:16: Error: Can't spread a value with static type 'Null'.
var s5 = {...n3, n1};
^") in let final dynamic #t33 = #t31.{core::Set::add}(let final Never #t34 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")) in #t31;
core::Set<Never> s6 = block {
final core::Set<Never> #t35 = col::LinkedHashSet::•<Never>();
final core::Iterable<Never>? #t36 = n3;
if(!#t36.{core::Object::==}(null))
for (final Never #t37 in #t36{core::Iterable<Never>})
#t35.{core::Set::add}(#t37);
#t35.{core::Set::add}(let final Never #t38 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t35;
core::Map<Never, Never> m1 = block {
final core::Map<Never, Never> #t39 = <Never, Never>{};
for (final core::MapEntry<Never, Never> #t40 in (let final Never #t41 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")).{core::Map::entries})
#t39.{core::Map::[]=}(#t40.{core::MapEntry::key}, #t40.{core::MapEntry::value});
#t39.{core::Map::[]=}(let final Never #t42 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final Never #t43 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t39;
core::Map<Never, Never> m2 = block {
final core::Map<Never, Never> #t44 = <Never, Never>{};
final core::Map<Never, Never>? #t45 = let final Never #t46 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
if(!#t45.{core::Object::==}(null))
for (final core::MapEntry<Never, Never> #t47 in #t45{core::Map<Never, Never>}.{core::Map::entries})
#t44.{core::Map::[]=}(#t47.{core::MapEntry::key}, #t47.{core::MapEntry::value});
#t44.{core::Map::[]=}(let final Never #t48 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final Never #t49 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t44;
core::Map<dynamic, dynamic> m3 = <dynamic, dynamic>{invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:20:16: Error: Can't spread a value with static type 'Never?'.
var m3 = {...n2, n1: n1};
^": null, let final Never #t50 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."): let final Never #t51 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")};
core::Map<Never, Never> m4 = block {
final core::Map<Never, Never> #t52 = <Never, Never>{};
final core::Map<Never, Never>? #t53 = n2;
if(!#t53.{core::Object::==}(null))
for (final core::MapEntry<Never, Never> #t54 in #t53{core::Map<Never, Never>}.{core::Map::entries})
#t52.{core::Map::[]=}(#t54.{core::MapEntry::key}, #t54.{core::MapEntry::value});
#t52.{core::Map::[]=}(let final Never #t55 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final Never #t56 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t52;
core::Map<dynamic, dynamic> m5 = <dynamic, dynamic>{invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:22:16: Error: Can't spread a value with static type 'Null'.
var m5 = {...n3, n1: n1};
^": null, let final Never #t57 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."): let final Never #t58 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")};
core::Map<Never, Never> m6 = block {
final core::Map<Never, Never> #t59 = <Never, Never>{};
final core::Map<Never, Never>? #t60 = n3;
if(!#t60.{core::Object::==}(null))
for (final core::MapEntry<Never, Never> #t61 in #t60{core::Map<Never, Never>}.{core::Map::entries})
#t59.{core::Map::[]=}(#t61.{core::MapEntry::key}, #t61.{core::MapEntry::value});
#t59.{core::Map::[]=}(let final Never #t62 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final Never #t63 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t59;
}
static method test2<N1 extends Never = Never, N2 extends Never? = Never?, N3 extends core::Null? = core::Null?>(self::test2::N1 n1, self::test2::N2% n2, self::test2::N3% n3) → dynamic {
core::List<Never> l1 = block {
final core::List<Never> #t64 = <Never>[];
for (final Never #t65 in let final self::test2::N1 #t66 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."))
#t64.{core::List::add}(#t65);
} =>#t64;
core::List<Never> l2 = block {
final core::List<Never> #t67 = <Never>[];
final core::Iterable<Never>? #t68 = let final self::test2::N1 #t69 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
if(!#t68.{core::Object::==}(null))
for (final Never #t70 in #t68{core::Iterable<Never>})
#t67.{core::List::add}(#t70);
} =>#t67;
core::List<dynamic> l3 = <dynamic>[invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:30:16: Error: Can't spread a value with static type 'N2'.
var l3 = [...n2];
^"];
core::List<Never> l4 = block {
final core::List<Never> #t71 = <Never>[];
final core::Iterable<Never>? #t72 = n2;
if(!#t72.{core::Object::==}(null))
for (final Never #t73 in #t72{core::Iterable<Never>})
#t71.{core::List::add}(#t73);
} =>#t71;
core::List<dynamic> l5 = <dynamic>[invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:32:16: Error: Can't spread a value with static type 'N3'.
var l5 = [...n3];
^"];
core::List<Never> l6 = block {
final core::List<Never> #t74 = <Never>[];
final core::Iterable<Never>? #t75 = n3;
if(!#t75.{core::Object::==}(null))
for (final Never #t76 in #t75{core::Iterable<Never>})
#t74.{core::List::add}(#t76);
} =>#t74;
core::Set<self::test2::N1> s1 = block {
final core::Set<self::test2::N1> #t77 = col::LinkedHashSet::•<self::test2::N1>();
for (final self::test2::N1 #t78 in let final self::test2::N1 #t79 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."))
#t77.{core::Set::add}(#t78);
#t77.{core::Set::add}(let final self::test2::N1 #t80 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t77;
core::Set<self::test2::N1> s2 = block {
final core::Set<self::test2::N1> #t81 = col::LinkedHashSet::•<self::test2::N1>();
final core::Iterable<self::test2::N1>? #t82 = let final self::test2::N1 #t83 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
if(!#t82.{core::Object::==}(null))
for (final self::test2::N1 #t84 in #t82{core::Iterable<self::test2::N1>})
#t81.{core::Set::add}(#t84);
#t81.{core::Set::add}(let final self::test2::N1 #t85 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t81;
core::Set<dynamic> s3 = let final core::Set<dynamic> #t86 = col::LinkedHashSet::•<dynamic>() in let final dynamic #t87 = #t86.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:36:16: Error: Can't spread a value with static type 'N2'.
var s3 = {...n2, n1};
^") in let final dynamic #t88 = #t86.{core::Set::add}(let final self::test2::N1 #t89 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")) in #t86;
core::Set<self::test2::N1> s4 = block {
final core::Set<self::test2::N1> #t90 = col::LinkedHashSet::•<self::test2::N1>();
final core::Iterable<self::test2::N1>? #t91 = n2;
if(!#t91.{core::Object::==}(null))
for (final self::test2::N1 #t92 in #t91{core::Iterable<self::test2::N1>})
#t90.{core::Set::add}(#t92);
#t90.{core::Set::add}(let final self::test2::N1 #t93 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t90;
core::Set<dynamic> s5 = let final core::Set<dynamic> #t94 = col::LinkedHashSet::•<dynamic>() in let final dynamic #t95 = #t94.{core::Set::add}(invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:38:16: Error: Can't spread a value with static type 'N3'.
var s5 = {...n3, n1};
^") in let final dynamic #t96 = #t94.{core::Set::add}(let final self::test2::N1 #t97 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")) in #t94;
core::Set<self::test2::N1> s6 = block {
final core::Set<self::test2::N1> #t98 = col::LinkedHashSet::•<self::test2::N1>();
final core::Iterable<self::test2::N1>? #t99 = n3;
if(!#t99.{core::Object::==}(null))
for (final self::test2::N1 #t100 in #t99{core::Iterable<self::test2::N1>})
#t98.{core::Set::add}(#t100);
#t98.{core::Set::add}(let final self::test2::N1 #t101 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t98;
core::Map<self::test2::N1, self::test2::N1> m1 = block {
final core::Map<self::test2::N1, self::test2::N1> #t102 = <self::test2::N1, self::test2::N1>{};
for (final core::MapEntry<self::test2::N1, self::test2::N1> #t103 in (let final self::test2::N1 #t104 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")).{core::Map::entries})
#t102.{core::Map::[]=}(#t103.{core::MapEntry::key}, #t103.{core::MapEntry::value});
#t102.{core::Map::[]=}(let final self::test2::N1 #t105 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final self::test2::N1 #t106 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t102;
core::Map<self::test2::N1, self::test2::N1> m2 = block {
final core::Map<self::test2::N1, self::test2::N1> #t107 = <self::test2::N1, self::test2::N1>{};
final core::Map<self::test2::N1, self::test2::N1>? #t108 = let final self::test2::N1 #t109 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.");
if(!#t108.{core::Object::==}(null))
for (final core::MapEntry<self::test2::N1, self::test2::N1> #t110 in #t108{core::Map<self::test2::N1, self::test2::N1>}.{core::Map::entries})
#t107.{core::Map::[]=}(#t110.{core::MapEntry::key}, #t110.{core::MapEntry::value});
#t107.{core::Map::[]=}(let final self::test2::N1 #t111 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final self::test2::N1 #t112 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t107;
core::Map<dynamic, dynamic> m3 = <dynamic, dynamic>{invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:42:16: Error: Can't spread a value with static type 'N2'.
var m3 = {...n2, n1: n1};
^": null, let final self::test2::N1 #t113 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."): let final self::test2::N1 #t114 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")};
core::Map<self::test2::N1, self::test2::N1> m4 = block {
final core::Map<self::test2::N1, self::test2::N1> #t115 = <self::test2::N1, self::test2::N1>{};
final core::Map<self::test2::N1, self::test2::N1>? #t116 = n2;
if(!#t116.{core::Object::==}(null))
for (final core::MapEntry<self::test2::N1, self::test2::N1> #t117 in #t116{core::Map<self::test2::N1, self::test2::N1>}.{core::Map::entries})
#t115.{core::Map::[]=}(#t117.{core::MapEntry::key}, #t117.{core::MapEntry::value});
#t115.{core::Map::[]=}(let final self::test2::N1 #t118 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final self::test2::N1 #t119 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t115;
core::Map<dynamic, dynamic> m5 = <dynamic, dynamic>{invalid-expression "pkg/front_end/testcases/nnbd/issue42758.dart:44:16: Error: Can't spread a value with static type 'N3'.
var m5 = {...n3, n1: n1};
^": null, let final self::test2::N1 #t120 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."): let final self::test2::N1 #t121 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`.")};
core::Map<self::test2::N1, self::test2::N1> m6 = block {
final core::Map<self::test2::N1, self::test2::N1> #t122 = <self::test2::N1, self::test2::N1>{};
final core::Map<self::test2::N1, self::test2::N1>? #t123 = n3;
if(!#t123.{core::Object::==}(null))
for (final core::MapEntry<self::test2::N1, self::test2::N1> #t124 in #t123{core::Map<self::test2::N1, self::test2::N1>}.{core::Map::entries})
#t122.{core::Map::[]=}(#t124.{core::MapEntry::key}, #t124.{core::MapEntry::value});
#t122.{core::Map::[]=}(let final self::test2::N1 #t125 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."), let final self::test2::N1 #t126 = n1 in throw new _in::ReachabilityError::•("`null` encountered as the result from expression with type `Never`."));
} =>#t122;
}
static method main() → dynamic {}