| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:22:10: Warning: Operand of null-aware operation '??=' has type 'String' which excludes null. |
| // super[42] ??= "bar"; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:27:3: Warning: Operand of null-aware operation '?.' has type 'String' which excludes null. |
| // s?.length; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:28:3: Warning: Operand of null-aware operation '?..' has type 'String' which excludes null. |
| // s?..length; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:29:3: Warning: Operand of null-aware operation '??' has type 'String' which excludes null. |
| // s ?? "foo"; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:30:3: Warning: Operand of null-aware operation '??=' has type 'String' which excludes null. |
| // s ??= "foo"; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:31:8: Warning: Operand of null-aware operation '...?' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // [...?l]; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:32:16: Warning: Operand of null-aware operation '...?' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // var a = {...?l}; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:33:16: Warning: Operand of null-aware operation '...?' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // <String>{...?l}; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:34:16: Warning: Operand of null-aware operation '...?' has type 'Map<String, int>' which excludes null. |
| // - 'Map' is from 'dart:core'. |
| // var b = {...?m}; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:35:21: Warning: Operand of null-aware operation '...?' has type 'Map<String, int>' which excludes null. |
| // - 'Map' is from 'dart:core'. |
| // <String, int>{...?m}; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:36:3: Warning: Operand of null-aware operation '!' has type 'String' which excludes null. |
| // s!; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:37:3: Warning: Operand of null-aware operation '?.' has type 'String' which excludes null. |
| // s?.substring(0, 0); // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:38:3: Warning: Operand of null-aware operation '?.' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // l?.length = 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:39:3: Warning: Operand of null-aware operation '?.' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // l?.length += 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:40:3: Warning: Operand of null-aware operation '?.' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // l?.length ??= 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:41:3: Warning: Operand of null-aware operation '?.' has type 'String' which excludes null. |
| // s?.foo; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:42:7: Warning: Operand of null-aware operation '??=' has type 'int' which excludes null. |
| // E(s)[42] ??= 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:43:4: Warning: Operand of null-aware operation '??=' has type 'String' which excludes null. |
| // l[42] ??= "foo"; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:44:5: Warning: Operand of null-aware operation '??=' has type 'int' which excludes null. |
| // l.length ??= 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:45:3: Warning: Operand of null-aware operation '?..' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // l?..length = 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:46:3: Warning: Operand of null-aware operation '?..' has type 'List<String>' which excludes null. |
| // - 'List' is from 'dart:core'. |
| // l?..length ??= 42; // Warning. |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/strictly_non_nullable_warnings.dart:46:7: Warning: Operand of null-aware operation '??=' has type 'int' which excludes null. |
| // l?..length ??= 42; // Warning. |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "dart:collection" as col; |
| |
| class A extends core::Object { |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| operator [](core::int index) → core::String |
| return "foo"; |
| operator []=(core::int index, core::String value) → void {} |
| } |
| class B extends self::A { |
| synthetic constructor •() → self::B |
| : super self::A::•() |
| ; |
| method test() → void { |
| let final core::int #t1 = 42 in super.{self::A::[]}(#t1) == null ?{core::String} super.{self::A::[]=}(#t1, "bar") : null; |
| } |
| } |
| extension E on core::String { |
| get foo = self::E|get#foo; |
| operator []= = self::E|[]=; |
| operator [] = self::E|[]; |
| } |
| static method E|get#foo(lowered final core::String #this) → core::int |
| return 42; |
| static method E|[]=(lowered final core::String #this, core::int index, core::int value) → void {} |
| static method E|[](lowered final core::String #this, core::int index) → core::int |
| return 42; |
| static method warning(core::String s, core::List<core::String> l, core::Map<core::String, core::int> m) → dynamic { |
| let final core::String #t2 = s in #t2 == null ?{core::int?} null : #t2.{core::String::length}{core::int}; |
| let final core::String #t3 = s in #t3 == null ?{core::String} null : block { |
| #t3.{core::String::length}{core::int}; |
| } =>#t3; |
| let final core::String #t4 = s in #t4 == null ?{core::String} "foo" : #t4; |
| s == null ?{core::String} s = "foo" : null; |
| block { |
| final core::List<core::String> #t5 = core::_GrowableList::•<core::String>(0); |
| final core::Iterable<core::String>? #t6 = l; |
| if(!(#t6 == null)) |
| #t5.{core::List::addAll}{Invariant}(#t6{core::Iterable<core::String>}){(core::Iterable<core::String>) → void}; |
| } =>#t5; |
| core::Set<core::String> a = block { |
| final core::Set<core::String> #t7 = new col::_CompactLinkedHashSet::•<core::String>(); |
| final core::Iterable<core::String>? #t8 = l; |
| if(!(#t8 == null)) |
| #t7.{core::Set::addAll}{Invariant}(#t8{core::Iterable<core::String>}){(core::Iterable<core::String>) → void}; |
| } =>#t7; |
| block { |
| final core::Set<core::String> #t9 = new col::_CompactLinkedHashSet::•<core::String>(); |
| final core::Iterable<core::String>? #t10 = l; |
| if(!(#t10 == null)) |
| #t9.{core::Set::addAll}{Invariant}(#t10{core::Iterable<core::String>}){(core::Iterable<core::String>) → void}; |
| } =>#t9; |
| core::Map<core::String, core::int> b = block { |
| final core::Map<core::String, core::int> #t11 = <core::String, core::int>{}; |
| final core::Map<core::String, core::int>? #t12 = m; |
| if(!(#t12 == null)) |
| #t11.{core::Map::addAll}{Invariant}(#t12{core::Map<core::String, core::int>}){(core::Map<core::String, core::int>) → void}; |
| } =>#t11; |
| block { |
| final core::Map<core::String, core::int> #t13 = <core::String, core::int>{}; |
| final core::Map<core::String, core::int>? #t14 = m; |
| if(!(#t14 == null)) |
| #t13.{core::Map::addAll}{Invariant}(#t14{core::Map<core::String, core::int>}){(core::Map<core::String, core::int>) → void}; |
| } =>#t13; |
| s!; |
| let final core::String #t15 = s in #t15 == null ?{core::String?} null : #t15.{core::String::substring}(0, 0){(core::int, [core::int?]) → core::String}; |
| let final core::List<core::String> #t16 = l in #t16 == null ?{core::int?} null : #t16.{core::List::length} = 42; |
| let final core::List<core::String> #t17 = l in #t17 == null ?{core::int?} null : #t17.{core::List::length} = #t17.{core::List::length}{core::int}.{core::num::+}(42){(core::num) → core::int}; |
| let final core::List<core::String> #t18 = l in #t18 == null ?{core::int?} null : #t18.{core::List::length}{core::int} == null ?{core::int} #t18.{core::List::length} = 42 : null; |
| let final core::String #t19 = s in #t19 == null ?{core::int?} null : self::E|get#foo(#t19); |
| let final core::String #t20 = s in let final core::int #t21 = 42 in self::E|[](#t20, #t21) == null ?{core::int} self::E|[]=(#t20, #t21, 42) : null; |
| let final core::List<core::String> #t22 = l in let final core::int #t23 = 42 in #t22.{core::List::[]}(#t23){(core::int) → core::String} == null ?{core::String} #t22.{core::List::[]=}(#t23, "foo"){(core::int, core::String) → void} : null; |
| let final core::List<core::String> #t24 = l in #t24.{core::List::length}{core::int} == null ?{core::int} #t24.{core::List::length} = 42 : null; |
| let final core::List<core::String> #t25 = l in #t25 == null ?{core::List<core::String>} null : block { |
| #t25.{core::List::length} = 42; |
| } =>#t25; |
| let final core::List<core::String> #t26 = l in #t26 == null ?{core::List<core::String>} null : block { |
| let final core::List<core::String> #t27 = #t26 in #t27.{core::List::length}{core::int} == null ?{core::int} #t27.{core::List::length} = 42 : null; |
| } =>#t26; |
| } |
| static method main() → dynamic {} |
| |
| |
| Extra constant evaluation status: |
| Evaluated: VariableGet @ org-dartlang-testcase:///strictly_non_nullable_warnings.dart:22:11 -> IntConstant(42) |
| Evaluated: VariableGet @ org-dartlang-testcase:///strictly_non_nullable_warnings.dart:22:11 -> IntConstant(42) |
| Evaluated: VariableGet @ org-dartlang-testcase:///strictly_non_nullable_warnings.dart:42:8 -> IntConstant(42) |
| Evaluated: VariableGet @ org-dartlang-testcase:///strictly_non_nullable_warnings.dart:42:8 -> IntConstant(42) |
| Evaluated: VariableGet @ org-dartlang-testcase:///strictly_non_nullable_warnings.dart:43:5 -> IntConstant(42) |
| Evaluated: VariableGet @ org-dartlang-testcase:///strictly_non_nullable_warnings.dart:43:5 -> IntConstant(42) |
| Extra constant evaluation: evaluated: 181, effectively constant: 6 |