| 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).{core::String::==}(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(final core::String #this) → core::int |
| return 42; |
| static method E|[]=(final core::String #this, core::int index, core::int value) → void {} |
| static method E|[](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.{core::String::==}(null) ?{core::int?} null : #t2.{core::String::length}; |
| let final core::String #t3 = s in #t3.{core::String::==}(null) ?{core::String} null : block { |
| #t3.{core::String::length}; |
| } =>#t3; |
| let final core::String #t4 = s in #t4.{core::String::==}(null) ?{core::String} "foo" : #t4; |
| s.{core::String::==}(null) ?{core::String} s = "foo" : null; |
| block { |
| final core::List<core::String> #t5 = <core::String>[]; |
| final core::Iterable<core::String>? #t6 = l; |
| if(!#t6.{core::Object::==}(null)) |
| for (final core::String #t7 in #t6{core::Iterable<core::String>}) |
| #t5.{core::List::add}(#t7); |
| } =>#t5; |
| core::Set<core::String> a = block { |
| final core::Set<core::String> #t8 = col::LinkedHashSet::•<core::String>(); |
| final core::Iterable<core::String>? #t9 = l; |
| if(!#t9.{core::Object::==}(null)) |
| for (final dynamic #t10 in #t9{core::Iterable<core::String>}) { |
| final core::String #t11 = #t10 as{TypeError,ForNonNullableByDefault} core::String; |
| #t8.{core::Set::add}(#t11); |
| } |
| } =>#t8; |
| block { |
| final core::Set<core::String> #t12 = col::LinkedHashSet::•<core::String>(); |
| final core::Iterable<core::String>? #t13 = l; |
| if(!#t13.{core::Object::==}(null)) |
| for (final core::String #t14 in #t13{core::Iterable<core::String>}) |
| #t12.{core::Set::add}(#t14); |
| } =>#t12; |
| core::Map<core::String, core::int> b = block { |
| final core::Map<core::String, core::int> #t15 = <core::String, core::int>{}; |
| final core::Map<core::String, core::int>? #t16 = m; |
| if(!#t16.{core::Object::==}(null)) |
| for (final core::MapEntry<core::String, core::int> #t17 in #t16{core::Map<core::String, core::int>}.{core::Map::entries}) |
| #t15.{core::Map::[]=}(#t17.{core::MapEntry::key}, #t17.{core::MapEntry::value}); |
| } =>#t15; |
| block { |
| final core::Map<core::String, core::int> #t18 = <core::String, core::int>{}; |
| final core::Map<core::String, core::int>? #t19 = m; |
| if(!#t19.{core::Object::==}(null)) |
| for (final core::MapEntry<core::String, core::int> #t20 in #t19{core::Map<core::String, core::int>}.{core::Map::entries}) |
| #t18.{core::Map::[]=}(#t20.{core::MapEntry::key}, #t20.{core::MapEntry::value}); |
| } =>#t18; |
| s!; |
| let final core::String #t21 = s in #t21.{core::String::==}(null) ?{core::String?} null : #t21.{core::String::substring}(0, 0); |
| let final core::List<core::String> #t22 = l in #t22.{core::List::==}(null) ?{core::int?} null : #t22.{core::List::length} = 42; |
| let final core::List<core::String> #t23 = l in #t23.{core::List::==}(null) ?{core::int?} null : #t23.{core::List::length} = #t23.{core::List::length}.{core::num::+}(42); |
| let final core::List<core::String> #t24 = l in #t24.{core::List::==}(null) ?{core::int?} null : #t24.{core::List::length}.{core::num::==}(null) ?{core::int} #t24.{core::List::length} = 42 : null; |
| let final core::String #t25 = s in #t25.{core::String::==}(null) ?{core::int?} null : self::E|get#foo(#t25); |
| let final core::String #t26 = s in let final core::int #t27 = 42 in self::E|[](#t26, #t27).{core::num::==}(null) ?{core::int} self::E|[]=(#t26, #t27, 42) : null; |
| let final core::List<core::String> #t28 = l in let final core::int #t29 = 42 in #t28.{core::List::[]}(#t29).{core::String::==}(null) ?{core::String} #t28.{core::List::[]=}(#t29, "foo") : null; |
| let final core::List<core::String> #t30 = l in #t30.{core::List::length}.{core::num::==}(null) ?{core::int} #t30.{core::List::length} = 42 : null; |
| let final core::List<core::String> #t31 = l in #t31.{core::List::==}(null) ?{core::List<core::String>} null : block { |
| #t31.{core::List::length} = 42; |
| } =>#t31; |
| let final core::List<core::String> #t32 = l in #t32.{core::List::==}(null) ?{core::List<core::String>} null : block { |
| let final core::List<core::String> #t33 = #t32 in #t33.{core::List::length}.{core::num::==}(null) ?{core::int} #t33.{core::List::length} = 42 : null; |
| } =>#t32; |
| } |
| static method main() → dynamic {} |