[vm] Make async transform resilient in context of invalid type and never type of iterables
The CFE can invoke transformations despite having compile-time errors. The async transform was crashing the compiler if it hits for-in iterables that have an invalid type or never type. In case of an invalid type, the program has a compile-time error and won't be able to run propertly. So we'll replace the entire for-in with an invalid expression statement if the iterable is an invalid expression. In case of a never type, the program should compile fine, which this CL also fixes. This makes the newly added tests no longer result in DartkCrash but rather in a compile-time error (invalid expression) or runtime-error (never type). Closes https://github.com/dart-lang/sdk/issues/45014 Change-Id: Ic50f68400b67b57dd4a2c0a125b08f0f3e0d8dd6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188463 Commit-Queue: Johnni Winther <johnniwinther@google.com> Reviewed-by: Johnni Winther <johnniwinther@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
700ba716cd
commit
dd1c3a3233
@@ -1,8 +1,12 @@
|
||||
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE.md file.
|
||||
|
||||
// @dart=2.9
|
||||
|
||||
foo() async {
|
||||
Bar x;
|
||||
for (dynamic y in x.z) {}
|
||||
}
|
||||
}
|
||||
|
||||
main() {}
|
||||
+1
@@ -1,2 +1,3 @@
|
||||
// @dart = 2.9
|
||||
foo() async {}
|
||||
main() {}
|
||||
|
||||
+1
@@ -1,2 +1,3 @@
|
||||
// @dart = 2.9
|
||||
foo() async {}
|
||||
main() {}
|
||||
|
||||
@@ -2,7 +2,7 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/async_method_with_invalid_type.dart:6:3: Error: 'Bar' isn't a type.
|
||||
// pkg/front_end/testcases/general/async_method_with_invalid_type.dart:8:3: Error: 'Bar' isn't a type.
|
||||
// Bar x;
|
||||
// ^^^
|
||||
//
|
||||
@@ -13,3 +13,4 @@ static method foo() → dynamic async {
|
||||
for (dynamic y in x.z) {
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
|
||||
+2
@@ -3,3 +3,5 @@ import self as self;
|
||||
|
||||
static method foo() → dynamic async
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/async_method_with_invalid_type.dart:8:3: Error: 'Bar' isn't a type.
|
||||
// Bar x;
|
||||
// ^^^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:async" as asy;
|
||||
import "dart:core" as core;
|
||||
|
||||
static method foo() → dynamic /* originally async */ {
|
||||
final asy::_Future<dynamic>* :async_future = new asy::_Future::•<dynamic>();
|
||||
core::bool* :is_sync = false;
|
||||
FutureOr<dynamic>* :return_value;
|
||||
(dynamic) →* dynamic :async_op_then;
|
||||
(core::Object*, core::StackTrace*) →* dynamic :async_op_error;
|
||||
core::int* :await_jump_var = 0;
|
||||
dynamic :await_ctx_var;
|
||||
function :async_op([dynamic :result, dynamic :exception, dynamic :stack_trace]) → dynamic yielding
|
||||
try {
|
||||
#L1:
|
||||
{
|
||||
invalid-type x;
|
||||
{
|
||||
core::Iterator<invalid-type>* :sync-for-iterator = x.z.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic y = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
}
|
||||
asy::_completeOnAsyncReturn(:async_future, :return_value, :is_sync);
|
||||
return;
|
||||
}
|
||||
on dynamic catch(dynamic exception, core::StackTrace* stack_trace) {
|
||||
asy::_completeOnAsyncError(:async_future, exception, stack_trace, :is_sync);
|
||||
}
|
||||
:async_op_then = asy::_asyncThenWrapperHelper(:async_op);
|
||||
:async_op_error = asy::_asyncErrorWrapperHelper(:async_op);
|
||||
:async_op.call();
|
||||
:is_sync = true;
|
||||
return :async_future;
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
@@ -1,7 +1,9 @@
|
||||
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// @dart=2.9
|
||||
|
||||
class C {
|
||||
C();
|
||||
factory C.fact() => null;
|
||||
|
||||
@@ -2,60 +2,60 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:20:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:22:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
// - 'List' is from 'dart:core'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the list literal or the context in which it is used.
|
||||
// List<int> a = <Object>[];
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:21:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:23:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
// - 'Map' is from 'dart:core'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the map literal or the context in which it is used.
|
||||
// Map<int, String> b = <Object, String>{};
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:22:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:24:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
// - 'Map' is from 'dart:core'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the map literal or the context in which it is used.
|
||||
// Map<int, String> c = <int, Object>{};
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:23:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:25:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the function expression or the context in which it is used.
|
||||
// int Function(Object) d = (int i) => i;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:26:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:28:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// - 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// - 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// Change the type of the object being constructed or the context in which it is used.
|
||||
// D g = new C.nonFact();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:27:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:29:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// - 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// - 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// Change the type of the object being constructed or the context in which it is used.
|
||||
// D h = new C.nonFact2();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:28:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:30:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the method or the context in which it is used.
|
||||
// void Function(Object) i = C.staticFunction;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:29:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:31:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the function or the context in which it is used.
|
||||
// void Function(Object) j = topLevelFunction;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:30:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:32:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the function or the context in which it is used.
|
||||
// void Function(Object) k = localFunction;
|
||||
@@ -99,54 +99,54 @@ class D extends self::C {
|
||||
static method topLevelFunction(core::int* i) → void {}
|
||||
static method bad() → dynamic {
|
||||
function localFunction(core::int* i) → void {}
|
||||
core::List<core::int*>* a = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:20:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
core::List<core::int*>* a = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:22:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
- 'List' is from 'dart:core'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the list literal or the context in which it is used.
|
||||
List<int> a = <Object>[];
|
||||
^" in <core::Object*>[];
|
||||
core::Map<core::int*, core::String*>* b = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:21:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
core::Map<core::int*, core::String*>* b = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:23:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
- 'Map' is from 'dart:core'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the map literal or the context in which it is used.
|
||||
Map<int, String> b = <Object, String>{};
|
||||
^" in <core::Object*, core::String*>{};
|
||||
core::Map<core::int*, core::String*>* c = let final Never* #t3 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:22:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
core::Map<core::int*, core::String*>* c = let final Never* #t3 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:24:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
- 'Map' is from 'dart:core'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the map literal or the context in which it is used.
|
||||
Map<int, String> c = <int, Object>{};
|
||||
^" in <core::int*, core::Object*>{};
|
||||
(core::Object*) →* core::int* d = let final Never* #t4 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:23:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
(core::Object*) →* core::int* d = let final Never* #t4 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:25:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the function expression or the context in which it is used.
|
||||
int Function(Object) d = (int i) => i;
|
||||
^" in (core::int* i) → core::int* => i;
|
||||
self::D* e = self::C::fact() as{TypeError} self::D*;
|
||||
self::D* f = new self::D::•() as{TypeError} self::D*;
|
||||
self::D* g = let final Never* #t5 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:26:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
self::D* g = let final Never* #t5 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:28:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
- 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
- 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
Change the type of the object being constructed or the context in which it is used.
|
||||
D g = new C.nonFact();
|
||||
^" in new self::C::nonFact();
|
||||
self::D* h = let final Never* #t6 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:27:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
self::D* h = let final Never* #t6 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:29:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
- 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
- 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
Change the type of the object being constructed or the context in which it is used.
|
||||
D h = new C.nonFact2();
|
||||
^" in new self::C::nonFact2();
|
||||
(core::Object*) →* void i = let final Never* #t7 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:28:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
(core::Object*) →* void i = let final Never* #t7 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:30:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the method or the context in which it is used.
|
||||
void Function(Object) i = C.staticFunction;
|
||||
^" in #C1;
|
||||
(core::Object*) →* void j = let final Never* #t8 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:29:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
(core::Object*) →* void j = let final Never* #t8 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:31:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the function or the context in which it is used.
|
||||
void Function(Object) j = topLevelFunction;
|
||||
^" in #C2;
|
||||
(core::Object*) →* void k = let final Never* #t9 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:30:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
(core::Object*) →* void k = let final Never* #t9 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:32:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the function or the context in which it is used.
|
||||
void Function(Object) k = localFunction;
|
||||
|
||||
@@ -2,60 +2,60 @@ library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:20:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:22:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
// - 'List' is from 'dart:core'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the list literal or the context in which it is used.
|
||||
// List<int> a = <Object>[];
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:21:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:23:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
// - 'Map' is from 'dart:core'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the map literal or the context in which it is used.
|
||||
// Map<int, String> b = <Object, String>{};
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:22:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:24:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
// - 'Map' is from 'dart:core'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the map literal or the context in which it is used.
|
||||
// Map<int, String> c = <int, Object>{};
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:23:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:25:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the function expression or the context in which it is used.
|
||||
// int Function(Object) d = (int i) => i;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:26:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:28:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// - 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// - 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// Change the type of the object being constructed or the context in which it is used.
|
||||
// D g = new C.nonFact();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:27:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:29:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
// - 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// - 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
// Change the type of the object being constructed or the context in which it is used.
|
||||
// D h = new C.nonFact2();
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:28:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:30:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the method or the context in which it is used.
|
||||
// void Function(Object) i = C.staticFunction;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:29:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:31:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the function or the context in which it is used.
|
||||
// void Function(Object) j = topLevelFunction;
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:30:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// pkg/front_end/testcases/general/invalid_cast.dart:32:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
// - 'Object' is from 'dart:core'.
|
||||
// Change the type of the function or the context in which it is used.
|
||||
// void Function(Object) k = localFunction;
|
||||
@@ -99,54 +99,54 @@ class D extends self::C {
|
||||
static method topLevelFunction(core::int* i) → void {}
|
||||
static method bad() → dynamic {
|
||||
function localFunction(core::int* i) → void {}
|
||||
core::List<core::int*>* a = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:20:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
core::List<core::int*>* a = let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:22:25: Error: The list literal type 'List<Object>' isn't of expected type 'List<int>'.
|
||||
- 'List' is from 'dart:core'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the list literal or the context in which it is used.
|
||||
List<int> a = <Object>[];
|
||||
^" in core::_GrowableList::•<core::Object*>(0);
|
||||
core::Map<core::int*, core::String*>* b = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:21:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
core::Map<core::int*, core::String*>* b = let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:23:40: Error: The map literal type 'Map<Object, String>' isn't of expected type 'Map<int, String>'.
|
||||
- 'Map' is from 'dart:core'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the map literal or the context in which it is used.
|
||||
Map<int, String> b = <Object, String>{};
|
||||
^" in <core::Object*, core::String*>{};
|
||||
core::Map<core::int*, core::String*>* c = let final Never* #t3 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:22:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
core::Map<core::int*, core::String*>* c = let final Never* #t3 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:24:37: Error: The map literal type 'Map<int, Object>' isn't of expected type 'Map<int, String>'.
|
||||
- 'Map' is from 'dart:core'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the map literal or the context in which it is used.
|
||||
Map<int, String> c = <int, Object>{};
|
||||
^" in <core::int*, core::Object*>{};
|
||||
(core::Object*) →* core::int* d = let final Never* #t4 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:23:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
(core::Object*) →* core::int* d = let final Never* #t4 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:25:28: Error: The function expression type 'int Function(int)' isn't of expected type 'int Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the function expression or the context in which it is used.
|
||||
int Function(Object) d = (int i) => i;
|
||||
^" in (core::int* i) → core::int* => i;
|
||||
self::D* e = self::C::fact() as{TypeError} self::D*;
|
||||
self::D* f = new self::D::•();
|
||||
self::D* g = let final Never* #t5 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:26:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
self::D* g = let final Never* #t5 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:28:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
- 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
- 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
Change the type of the object being constructed or the context in which it is used.
|
||||
D g = new C.nonFact();
|
||||
^" in new self::C::nonFact();
|
||||
self::D* h = let final Never* #t6 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:27:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
self::D* h = let final Never* #t6 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:29:13: Error: The constructor returns type 'C' that isn't of expected type 'D'.
|
||||
- 'C' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
- 'D' is from 'pkg/front_end/testcases/general/invalid_cast.dart'.
|
||||
Change the type of the object being constructed or the context in which it is used.
|
||||
D h = new C.nonFact2();
|
||||
^" in new self::C::nonFact2();
|
||||
(core::Object*) →* void i = let final Never* #t7 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:28:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
(core::Object*) →* void i = let final Never* #t7 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:30:31: Error: The static method has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the method or the context in which it is used.
|
||||
void Function(Object) i = C.staticFunction;
|
||||
^" in #C1;
|
||||
(core::Object*) →* void j = let final Never* #t8 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:29:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
(core::Object*) →* void j = let final Never* #t8 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:31:29: Error: The top level function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the function or the context in which it is used.
|
||||
void Function(Object) j = topLevelFunction;
|
||||
^" in #C2;
|
||||
(core::Object*) →* void k = let final Never* #t9 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:30:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
(core::Object*) →* void k = let final Never* #t9 = invalid-expression "pkg/front_end/testcases/general/invalid_cast.dart:32:29: Error: The local function has type 'void Function(int)' that isn't of expected type 'void Function(Object)'.
|
||||
- 'Object' is from 'dart:core'.
|
||||
Change the type of the function or the context in which it is used.
|
||||
void Function(Object) k = localFunction;
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
// @dart=2.9
|
||||
|
||||
Iterable takesNoArg() => null;
|
||||
void returnVoid() {}
|
||||
int returnInt() => 42;
|
||||
dynamic returnDynamic() => [];
|
||||
Object returnObject() => 0;
|
||||
|
||||
test() {
|
||||
for (var v in takesNoArg(0)) {}
|
||||
for (var v in returnVoid()) {}
|
||||
for (var v in returnInt()) {}
|
||||
for (var v in returnDynamic()) {}
|
||||
for (var v in returnObject()) {}
|
||||
for (var v in throw '') {}
|
||||
}
|
||||
|
||||
main() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
// @dart = 2.9
|
||||
Iterable takesNoArg() => null;
|
||||
void returnVoid() {}
|
||||
int returnInt() => 42;
|
||||
dynamic returnDynamic() => [];
|
||||
Object returnObject() => 0;
|
||||
test() {}
|
||||
main() {}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// @dart = 2.9
|
||||
Iterable takesNoArg() => null;
|
||||
Object returnObject() => 0;
|
||||
dynamic returnDynamic() => [];
|
||||
int returnInt() => 42;
|
||||
main() {}
|
||||
test() {}
|
||||
void returnVoid() {}
|
||||
@@ -0,0 +1,56 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:14:27: Error: Too many positional arguments: 0 allowed, but 1 found.
|
||||
// Try removing the extra positional arguments.
|
||||
// for (var v in takesNoArg(0)) {}
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:7:10: Context: Found this candidate, but the arguments don't match.
|
||||
// Iterable takesNoArg() => null;
|
||||
// ^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:15:17: Error: This expression has type 'void' and can't be used.
|
||||
// for (var v in returnVoid()) {}
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:16:17: Error: The type 'int' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// for (var v in returnInt()) {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
static method takesNoArg() → core::Iterable<dynamic>*
|
||||
return null;
|
||||
static method returnVoid() → void {}
|
||||
static method returnInt() → core::int*
|
||||
return 42;
|
||||
static method returnDynamic() → dynamic
|
||||
return <dynamic>[];
|
||||
static method returnObject() → core::Object*
|
||||
return 0;
|
||||
static method test() → dynamic {
|
||||
for (dynamic v in invalid-expression "pkg/front_end/testcases/general/invalid_for_in_iterable.dart:14:27: Error: Too many positional arguments: 0 allowed, but 1 found.
|
||||
Try removing the extra positional arguments.
|
||||
for (var v in takesNoArg(0)) {}
|
||||
^" as{TypeError,ForDynamic} core::Iterable<dynamic>*) {
|
||||
}
|
||||
for (dynamic v in let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_for_in_iterable.dart:15:17: Error: This expression has type 'void' and can't be used.
|
||||
for (var v in returnVoid()) {}
|
||||
^" in self::returnVoid()) {
|
||||
}
|
||||
for (dynamic v in let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_for_in_iterable.dart:16:17: Error: The type 'int' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
for (var v in returnInt()) {}
|
||||
^" in self::returnInt() as{TypeError} core::Iterable<dynamic>*) {
|
||||
}
|
||||
for (dynamic v in self::returnDynamic() as{TypeError,ForDynamic} core::Iterable<dynamic>*) {
|
||||
}
|
||||
for (dynamic v in self::returnObject() as{TypeError} core::Iterable<dynamic>*) {
|
||||
}
|
||||
for (dynamic v in throw "") {
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
@@ -0,0 +1,18 @@
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
static method takesNoArg() → core::Iterable<dynamic>*
|
||||
;
|
||||
static method returnVoid() → void
|
||||
;
|
||||
static method returnInt() → core::int*
|
||||
;
|
||||
static method returnDynamic() → dynamic
|
||||
;
|
||||
static method returnObject() → core::Object*
|
||||
;
|
||||
static method test() → dynamic
|
||||
;
|
||||
static method main() → dynamic
|
||||
;
|
||||
@@ -0,0 +1,86 @@
|
||||
library;
|
||||
//
|
||||
// Problems in library:
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:14:27: Error: Too many positional arguments: 0 allowed, but 1 found.
|
||||
// Try removing the extra positional arguments.
|
||||
// for (var v in takesNoArg(0)) {}
|
||||
// ^
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:7:10: Context: Found this candidate, but the arguments don't match.
|
||||
// Iterable takesNoArg() => null;
|
||||
// ^^^^^^^^^^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:15:17: Error: This expression has type 'void' and can't be used.
|
||||
// for (var v in returnVoid()) {}
|
||||
// ^
|
||||
//
|
||||
// pkg/front_end/testcases/general/invalid_for_in_iterable.dart:16:17: Error: The type 'int' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
// - 'Iterable' is from 'dart:core'.
|
||||
// for (var v in returnInt()) {}
|
||||
// ^
|
||||
//
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
static method takesNoArg() → core::Iterable<dynamic>*
|
||||
return null;
|
||||
static method returnVoid() → void {}
|
||||
static method returnInt() → core::int*
|
||||
return 42;
|
||||
static method returnDynamic() → dynamic
|
||||
return core::_GrowableList::•<dynamic>(0);
|
||||
static method returnObject() → core::Object*
|
||||
return 0;
|
||||
static method test() → dynamic {
|
||||
{
|
||||
core::Iterator<dynamic>* :sync-for-iterator = invalid-expression "pkg/front_end/testcases/general/invalid_for_in_iterable.dart:14:27: Error: Too many positional arguments: 0 allowed, but 1 found.
|
||||
Try removing the extra positional arguments.
|
||||
for (var v in takesNoArg(0)) {}
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic v = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
{
|
||||
core::Iterator<invalid-type>* :sync-for-iterator = (let final Never* #t1 = invalid-expression "pkg/front_end/testcases/general/invalid_for_in_iterable.dart:15:17: Error: This expression has type 'void' and can't be used.
|
||||
for (var v in returnVoid()) {}
|
||||
^" in self::returnVoid()).{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic v = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
{
|
||||
core::Iterator<dynamic>* :sync-for-iterator = (let final Never* #t2 = invalid-expression "pkg/front_end/testcases/general/invalid_for_in_iterable.dart:16:17: Error: The type 'int' used in the 'for' loop must implement 'Iterable<dynamic>'.
|
||||
- 'Iterable' is from 'dart:core'.
|
||||
for (var v in returnInt()) {}
|
||||
^" in self::returnInt() as{TypeError} core::Iterable<dynamic>*).{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic v = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
{
|
||||
core::Iterator<dynamic>* :sync-for-iterator = (self::returnDynamic() as{TypeError,ForDynamic} core::Iterable<dynamic>*).{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic v = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
{
|
||||
core::Iterator<dynamic>* :sync-for-iterator = (self::returnObject() as{TypeError} core::Iterable<dynamic>*).{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic v = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
{
|
||||
core::Iterator<Never*>* :sync-for-iterator = (throw "").{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic v = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
}
|
||||
static method main() → dynamic {}
|
||||
@@ -1,9 +1,15 @@
|
||||
library;
|
||||
import self as self;
|
||||
import "dart:core" as core;
|
||||
|
||||
static method foo() → dynamic {
|
||||
Null _null;
|
||||
for (dynamic i in _null) {
|
||||
{
|
||||
core::Iterator<invalid-type>* :sync-for-iterator = _null.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic i = :sync-for-iterator.{core::Iterator::current};
|
||||
{}
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
|
||||
@@ -171,27 +171,45 @@ import "dart:collection" as col;
|
||||
static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::List<core::int>? a, core::Set<core::int>? b, core::Iterable<core::int>? c, core::Map<core::int, core::int>? d) → dynamic {
|
||||
return <core::Object>[ block {
|
||||
final core::Set<core::int> #t1 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t2 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:8:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:8:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...a}, // Error.
|
||||
^") {
|
||||
final core::int #t3 = #t2 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t1.{core::Set::add}{Invariant}(#t3);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t2 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t3 = #t2 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t1.{core::Set::add}{Invariant}(#t3);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t1, block {
|
||||
final core::Set<core::int> #t4 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t5 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:9:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:9:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...b}, // Error.
|
||||
^") {
|
||||
final core::int #t6 = #t5 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t4.{core::Set::add}{Invariant}(#t6);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t5 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t6 = #t5 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t4.{core::Set::add}{Invariant}(#t6);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t4, block {
|
||||
final core::Set<core::int> #t7 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t8 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:10:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:10:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...c}, // Error.
|
||||
^") {
|
||||
final core::int #t9 = #t8 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t7.{core::Set::add}{Invariant}(#t9);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t8 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t9 = #t8 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t7.{core::Set::add}{Invariant}(#t9);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t7, <core::int, core::int>{invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:11:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...d}, // Error.
|
||||
@@ -206,31 +224,46 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
^");
|
||||
} =>#t10, block {
|
||||
final core::Set<core::int> #t11 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t12 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:14:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:14:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...a}, // Error.
|
||||
^") {
|
||||
final core::int #t13 = #t12 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t11.{core::Set::add}{Invariant}(#t13);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t12 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t13 = #t12 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t11.{core::Set::add}{Invariant}(#t13);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t11, block {
|
||||
final core::Set<core::int> #t14 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t15 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:15:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:15:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...b}, // Error.
|
||||
^") {
|
||||
final core::int #t16 = #t15 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t14.{core::Set::add}{Invariant}(#t16);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t15 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t16 = #t15 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t14.{core::Set::add}{Invariant}(#t16);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t14, block {
|
||||
final core::Set<core::int> #t17 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t18 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:16:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:16:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...c}, // Error.
|
||||
^") {
|
||||
final core::int #t19 = #t18 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t17.{core::Set::add}{Invariant}(#t19);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t18 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t19 = #t18 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t17.{core::Set::add}{Invariant}(#t19);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t17, block {
|
||||
final core::Map<core::int, core::int> #t20 = <core::int, core::int>{};
|
||||
if(condition)
|
||||
@@ -243,11 +276,17 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t22 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:18:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:18:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...a}, // Error.
|
||||
^") {
|
||||
final core::int #t23 = #t22 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t21.{core::Set::add}{Invariant}(#t23);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t22 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t23 = #t22 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t21.{core::Set::add}{Invariant}(#t23);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,11 +296,17 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t25 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:19:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:19:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...b}, // Error.
|
||||
^") {
|
||||
final core::int #t26 = #t25 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t24.{core::Set::add}{Invariant}(#t26);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t25 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t26 = #t25 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t24.{core::Set::add}{Invariant}(#t26);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,11 +316,17 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t28 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:20:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:20:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...c}, // Error.
|
||||
^") {
|
||||
final core::int #t29 = #t28 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t27.{core::Set::add}{Invariant}(#t29);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t28 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t29 = #t28 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t27.{core::Set::add}{Invariant}(#t29);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,31 +343,46 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
}
|
||||
} =>#t30, block {
|
||||
final core::Set<core::int> #t31 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t32 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:22:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:22:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...a}, // Error.
|
||||
^") {
|
||||
final core::int #t33 = #t32 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t31.{core::Set::add}{Invariant}(#t33);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t32 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t33 = #t32 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t31.{core::Set::add}{Invariant}(#t33);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t31, block {
|
||||
final core::Set<core::int> #t34 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t35 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:23:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:23:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...b}, // Error.
|
||||
^") {
|
||||
final core::int #t36 = #t35 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t34.{core::Set::add}{Invariant}(#t36);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t35 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t36 = #t35 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t34.{core::Set::add}{Invariant}(#t36);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t34, block {
|
||||
final core::Set<core::int> #t37 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t38 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:24:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:24:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...c}, // Error.
|
||||
^") {
|
||||
final core::int #t39 = #t38 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t37.{core::Set::add}{Invariant}(#t39);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t38 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t39 = #t38 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t37.{core::Set::add}{Invariant}(#t39);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t37, block {
|
||||
final core::Map<core::int, core::int> #t40 = <core::int, core::int>{};
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
@@ -572,27 +638,45 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y extends core::Set<core::int>? = core::Set<core::int>?, Z extends core::Iterable<core::int>? = core::Iterable<core::int>?, W extends core::Map<core::int, core::int>? = core::Map<core::int, core::int>?>(core::bool condition, core::Iterable<dynamic> iterable, self::bar::X% x, self::bar::Y% y, self::bar::Z% z, self::bar::W% w) → dynamic {
|
||||
return <core::Object>[ block {
|
||||
final core::Set<core::int> #t101 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t102 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:50:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:50:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...x}, // Error.
|
||||
^") {
|
||||
final core::int #t103 = #t102 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t101.{core::Set::add}{Invariant}(#t103);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t102 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t103 = #t102 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t101.{core::Set::add}{Invariant}(#t103);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t101, block {
|
||||
final core::Set<core::int> #t104 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t105 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:51:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:51:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...y}, // Error.
|
||||
^") {
|
||||
final core::int #t106 = #t105 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t104.{core::Set::add}{Invariant}(#t106);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t105 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t106 = #t105 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t104.{core::Set::add}{Invariant}(#t106);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t104, block {
|
||||
final core::Set<core::int> #t107 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t108 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:52:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:52:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...z}, // Error.
|
||||
^") {
|
||||
final core::int #t109 = #t108 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t107.{core::Set::add}{Invariant}(#t109);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t108 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t109 = #t108 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t107.{core::Set::add}{Invariant}(#t109);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t107, <core::int, core::int>{invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:53:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...w}, // Error.
|
||||
@@ -605,31 +689,46 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
^");
|
||||
} =>#t110, block {
|
||||
final core::Set<core::int> #t111 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t112 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:56:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:56:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...x}, // Error.
|
||||
^") {
|
||||
final core::int #t113 = #t112 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t111.{core::Set::add}{Invariant}(#t113);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t112 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t113 = #t112 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t111.{core::Set::add}{Invariant}(#t113);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t111, block {
|
||||
final core::Set<core::int> #t114 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t115 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:57:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:57:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...y}, // Error.
|
||||
^") {
|
||||
final core::int #t116 = #t115 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t114.{core::Set::add}{Invariant}(#t116);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t115 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t116 = #t115 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t114.{core::Set::add}{Invariant}(#t116);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t114, block {
|
||||
final core::Set<core::int> #t117 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t118 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:58:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:58:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...z}, // Error.
|
||||
^") {
|
||||
final core::int #t119 = #t118 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t117.{core::Set::add}{Invariant}(#t119);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t118 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t119 = #t118 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t117.{core::Set::add}{Invariant}(#t119);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t117, block {
|
||||
final core::Map<core::int, core::int> #t120 = <core::int, core::int>{};
|
||||
if(condition)
|
||||
@@ -642,11 +741,17 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t122 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:60:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:60:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...x}, // Error.
|
||||
^") {
|
||||
final core::int #t123 = #t122 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t121.{core::Set::add}{Invariant}(#t123);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t122 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t123 = #t122 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t121.{core::Set::add}{Invariant}(#t123);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -656,11 +761,17 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t125 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:61:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:61:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...y}, // Error.
|
||||
^") {
|
||||
final core::int #t126 = #t125 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t124.{core::Set::add}{Invariant}(#t126);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t125 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t126 = #t125 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t124.{core::Set::add}{Invariant}(#t126);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -670,11 +781,17 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t128 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:62:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:62:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...z}, // Error.
|
||||
^") {
|
||||
final core::int #t129 = #t128 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t127.{core::Set::add}{Invariant}(#t129);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t128 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t129 = #t128 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t127.{core::Set::add}{Invariant}(#t129);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -691,31 +808,46 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
}
|
||||
} =>#t130, block {
|
||||
final core::Set<core::int> #t131 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t132 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:64:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:64:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...x}, // Error.
|
||||
^") {
|
||||
final core::int #t133 = #t132 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t131.{core::Set::add}{Invariant}(#t133);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t132 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t133 = #t132 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t131.{core::Set::add}{Invariant}(#t133);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t131, block {
|
||||
final core::Set<core::int> #t134 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t135 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:65:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:65:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...y}, // Error.
|
||||
^") {
|
||||
final core::int #t136 = #t135 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t134.{core::Set::add}{Invariant}(#t136);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t135 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t136 = #t135 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t134.{core::Set::add}{Invariant}(#t136);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t134, block {
|
||||
final core::Set<core::int> #t137 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t138 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:66:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:66:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...z}, // Error.
|
||||
^") {
|
||||
final core::int #t139 = #t138 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t137.{core::Set::add}{Invariant}(#t139);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t138 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t139 = #t138 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t137.{core::Set::add}{Invariant}(#t139);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t137, block {
|
||||
final core::Map<core::int, core::int> #t140 = <core::int, core::int>{};
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
|
||||
@@ -171,27 +171,45 @@ import "dart:collection" as col;
|
||||
static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::List<core::int>? a, core::Set<core::int>? b, core::Iterable<core::int>? c, core::Map<core::int, core::int>? d) → dynamic {
|
||||
return <core::Object>[ block {
|
||||
final core::Set<core::int> #t1 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t2 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:8:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:8:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...a}, // Error.
|
||||
^") {
|
||||
final core::int #t3 = #t2 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t1.{core::Set::add}{Invariant}(#t3);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t2 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t3 = #t2 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t1.{core::Set::add}{Invariant}(#t3);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t1, block {
|
||||
final core::Set<core::int> #t4 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t5 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:9:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:9:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...b}, // Error.
|
||||
^") {
|
||||
final core::int #t6 = #t5 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t4.{core::Set::add}{Invariant}(#t6);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t5 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t6 = #t5 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t4.{core::Set::add}{Invariant}(#t6);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t4, block {
|
||||
final core::Set<core::int> #t7 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t8 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:10:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:10:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...c}, // Error.
|
||||
^") {
|
||||
final core::int #t9 = #t8 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t7.{core::Set::add}{Invariant}(#t9);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t8 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t9 = #t8 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t7.{core::Set::add}{Invariant}(#t9);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t7, <core::int, core::int>{invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:11:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...d}, // Error.
|
||||
@@ -206,31 +224,46 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
^");
|
||||
} =>#t10, block {
|
||||
final core::Set<core::int> #t11 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t12 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:14:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:14:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...a}, // Error.
|
||||
^") {
|
||||
final core::int #t13 = #t12 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t11.{core::Set::add}{Invariant}(#t13);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t12 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t13 = #t12 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t11.{core::Set::add}{Invariant}(#t13);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t11, block {
|
||||
final core::Set<core::int> #t14 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t15 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:15:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:15:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...b}, // Error.
|
||||
^") {
|
||||
final core::int #t16 = #t15 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t14.{core::Set::add}{Invariant}(#t16);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t15 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t16 = #t15 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t14.{core::Set::add}{Invariant}(#t16);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t14, block {
|
||||
final core::Set<core::int> #t17 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t18 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:16:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:16:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...c}, // Error.
|
||||
^") {
|
||||
final core::int #t19 = #t18 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t17.{core::Set::add}{Invariant}(#t19);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t18 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t19 = #t18 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t17.{core::Set::add}{Invariant}(#t19);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t17, block {
|
||||
final core::Map<core::int, core::int> #t20 = <core::int, core::int>{};
|
||||
if(condition)
|
||||
@@ -243,11 +276,17 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t22 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:18:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:18:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...a}, // Error.
|
||||
^") {
|
||||
final core::int #t23 = #t22 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t21.{core::Set::add}{Invariant}(#t23);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t22 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t23 = #t22 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t21.{core::Set::add}{Invariant}(#t23);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -257,11 +296,17 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t25 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:19:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:19:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...b}, // Error.
|
||||
^") {
|
||||
final core::int #t26 = #t25 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t24.{core::Set::add}{Invariant}(#t26);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t25 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t26 = #t25 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t24.{core::Set::add}{Invariant}(#t26);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,11 +316,17 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t28 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:20:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:20:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...c}, // Error.
|
||||
^") {
|
||||
final core::int #t29 = #t28 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t27.{core::Set::add}{Invariant}(#t29);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t28 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t29 = #t28 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t27.{core::Set::add}{Invariant}(#t29);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -292,31 +343,46 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
}
|
||||
} =>#t30, block {
|
||||
final core::Set<core::int> #t31 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t32 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:22:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:22:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...a}, // Error.
|
||||
^") {
|
||||
final core::int #t33 = #t32 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t31.{core::Set::add}{Invariant}(#t33);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t32 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t33 = #t32 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t31.{core::Set::add}{Invariant}(#t33);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t31, block {
|
||||
final core::Set<core::int> #t34 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t35 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:23:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:23:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...b}, // Error.
|
||||
^") {
|
||||
final core::int #t36 = #t35 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t34.{core::Set::add}{Invariant}(#t36);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t35 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t36 = #t35 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t34.{core::Set::add}{Invariant}(#t36);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t34, block {
|
||||
final core::Set<core::int> #t37 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t38 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:24:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:24:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...c}, // Error.
|
||||
^") {
|
||||
final core::int #t39 = #t38 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t37.{core::Set::add}{Invariant}(#t39);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t38 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t39 = #t38 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t37.{core::Set::add}{Invariant}(#t39);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t37, block {
|
||||
final core::Map<core::int, core::int> #t40 = <core::int, core::int>{};
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
@@ -572,27 +638,45 @@ static method foo(core::bool condition, core::Iterable<dynamic> iterable, core::
|
||||
static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y extends core::Set<core::int>? = core::Set<core::int>?, Z extends core::Iterable<core::int>? = core::Iterable<core::int>?, W extends core::Map<core::int, core::int>? = core::Map<core::int, core::int>?>(core::bool condition, core::Iterable<dynamic> iterable, self::bar::X% x, self::bar::Y% y, self::bar::Z% z, self::bar::W% w) → dynamic {
|
||||
return <core::Object>[ block {
|
||||
final core::Set<core::int> #t101 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t102 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:50:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:50:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...x}, // Error.
|
||||
^") {
|
||||
final core::int #t103 = #t102 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t101.{core::Set::add}{Invariant}(#t103);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t102 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t103 = #t102 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t101.{core::Set::add}{Invariant}(#t103);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t101, block {
|
||||
final core::Set<core::int> #t104 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t105 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:51:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:51:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...y}, // Error.
|
||||
^") {
|
||||
final core::int #t106 = #t105 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t104.{core::Set::add}{Invariant}(#t106);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t105 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t106 = #t105 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t104.{core::Set::add}{Invariant}(#t106);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t104, block {
|
||||
final core::Set<core::int> #t107 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (final dynamic #t108 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:52:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:52:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...z}, // Error.
|
||||
^") {
|
||||
final core::int #t109 = #t108 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t107.{core::Set::add}{Invariant}(#t109);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t108 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t109 = #t108 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t107.{core::Set::add}{Invariant}(#t109);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t107, <core::int, core::int>{invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:53:9: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{...w}, // Error.
|
||||
@@ -605,31 +689,46 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
^");
|
||||
} =>#t110, block {
|
||||
final core::Set<core::int> #t111 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t112 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:56:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:56:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...x}, // Error.
|
||||
^") {
|
||||
final core::int #t113 = #t112 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t111.{core::Set::add}{Invariant}(#t113);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t112 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t113 = #t112 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t111.{core::Set::add}{Invariant}(#t113);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t111, block {
|
||||
final core::Set<core::int> #t114 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t115 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:57:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:57:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...y}, // Error.
|
||||
^") {
|
||||
final core::int #t116 = #t115 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t114.{core::Set::add}{Invariant}(#t116);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t115 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t116 = #t115 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t114.{core::Set::add}{Invariant}(#t116);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t114, block {
|
||||
final core::Set<core::int> #t117 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
if(condition)
|
||||
for (final dynamic #t118 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:58:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
if(condition) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:58:24: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{if (condition) ...z}, // Error.
|
||||
^") {
|
||||
final core::int #t119 = #t118 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t117.{core::Set::add}{Invariant}(#t119);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t118 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t119 = #t118 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t117.{core::Set::add}{Invariant}(#t119);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t117, block {
|
||||
final core::Map<core::int, core::int> #t120 = <core::int, core::int>{};
|
||||
if(condition)
|
||||
@@ -642,11 +741,17 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t122 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:60:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:60:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...x}, // Error.
|
||||
^") {
|
||||
final core::int #t123 = #t122 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t121.{core::Set::add}{Invariant}(#t123);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t122 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t123 = #t122 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t121.{core::Set::add}{Invariant}(#t123);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -656,11 +761,17 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t125 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:61:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:61:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...y}, // Error.
|
||||
^") {
|
||||
final core::int #t126 = #t125 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t124.{core::Set::add}{Invariant}(#t126);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t125 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t126 = #t125 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t124.{core::Set::add}{Invariant}(#t126);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -670,11 +781,17 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
core::Iterator<dynamic> :sync-for-iterator = iterable.{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
dynamic e = :sync-for-iterator.{core::Iterator::current};
|
||||
for (final dynamic #t128 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:62:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:62:37: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (dynamic e in iterable) ...z}, // Error.
|
||||
^") {
|
||||
final core::int #t129 = #t128 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t127.{core::Set::add}{Invariant}(#t129);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t128 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t129 = #t128 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t127.{core::Set::add}{Invariant}(#t129);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -691,31 +808,46 @@ static method bar<X extends core::List<core::int>? = core::List<core::int>?, Y e
|
||||
}
|
||||
} =>#t130, block {
|
||||
final core::Set<core::int> #t131 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t132 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:64:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:64:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...x}, // Error.
|
||||
^") {
|
||||
final core::int #t133 = #t132 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t131.{core::Set::add}{Invariant}(#t133);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t132 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t133 = #t132 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t131.{core::Set::add}{Invariant}(#t133);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t131, block {
|
||||
final core::Set<core::int> #t134 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t135 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:65:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:65:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...y}, // Error.
|
||||
^") {
|
||||
final core::int #t136 = #t135 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t134.{core::Set::add}{Invariant}(#t136);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t135 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t136 = #t135 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t134.{core::Set::add}{Invariant}(#t136);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t134, block {
|
||||
final core::Set<core::int> #t137 = new col::_CompactLinkedHashSet::•<core::int>();
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
for (final dynamic #t138 in invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:66:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1)) {
|
||||
core::Iterator<Never> :sync-for-iterator = invalid-expression "pkg/front_end/testcases/nnbd/issue43495.dart:66:38: Error: An expression whose value can be 'null' must be null-checked before it can be dereferenced.
|
||||
{for (int i = 0; i < 42; ++i) ...z}, // Error.
|
||||
^") {
|
||||
final core::int #t139 = #t138 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t137.{core::Set::add}{Invariant}(#t139);
|
||||
^".{core::Iterable::iterator};
|
||||
for (; :sync-for-iterator.{core::Iterator::moveNext}(); ) {
|
||||
final dynamic #t138 = :sync-for-iterator.{core::Iterator::current};
|
||||
{
|
||||
final core::int #t139 = #t138 as{TypeError,ForNonNullableByDefault} core::int;
|
||||
#t137.{core::Set::add}{Invariant}(#t139);
|
||||
}
|
||||
}
|
||||
}
|
||||
} =>#t137, block {
|
||||
final core::Map<core::int, core::int> #t140 = <core::int, core::int>{};
|
||||
for (core::int i = 0; i.{core::num::<}(42); i = i.{core::num::+}(1))
|
||||
|
||||
@@ -18,7 +18,6 @@ extensions/static_access_of_instance: RuntimeError
|
||||
general/abstract_members: TypeCheckError
|
||||
general/accessors: RuntimeError
|
||||
general/ambiguous_exports: RuntimeError
|
||||
general/async_method_with_invalid_type: Crash
|
||||
general/await_in_non_async: RuntimeError
|
||||
general/bug21938: TypeCheckError
|
||||
general/bug30695: TypeCheckError
|
||||
|
||||
@@ -21,7 +21,6 @@ extensions/static_access_of_instance: RuntimeError
|
||||
general/abstract_members: TypeCheckError
|
||||
general/accessors: RuntimeError
|
||||
general/ambiguous_exports: RuntimeError # Expected, this file exports two main methods.
|
||||
general/async_method_with_invalid_type: Crash
|
||||
general/await_in_non_async: RuntimeError # Expected.
|
||||
general/bug21938: TypeCheckError
|
||||
general/bug30695: TypeCheckError
|
||||
|
||||
+15
-4
@@ -9119,15 +9119,26 @@ class ForInStatement extends Statement {
|
||||
TypeParameterType typeParameterType = iterableType;
|
||||
iterableType = typeParameterType.bound;
|
||||
}
|
||||
if (iterableType is NeverType) {
|
||||
return iterableType;
|
||||
}
|
||||
if (iterableType is InvalidType) {
|
||||
return iterableType;
|
||||
}
|
||||
if (iterableType is! InterfaceType) {
|
||||
// TODO(johnniwinther): Change this to an assert once the CFE correctly
|
||||
// inserts casts for all invalid iterable types.
|
||||
return const InvalidType();
|
||||
}
|
||||
if (isAsync) {
|
||||
List<DartType> typeArguments = context.typeEnvironment
|
||||
.getTypeArgumentsAsInstanceOf(iterableType as InterfaceType,
|
||||
context.typeEnvironment.coreTypes.streamClass)!;
|
||||
.getTypeArgumentsAsInstanceOf(
|
||||
iterableType, context.typeEnvironment.coreTypes.streamClass)!;
|
||||
return typeArguments.single;
|
||||
} else {
|
||||
List<DartType> typeArguments = context.typeEnvironment
|
||||
.getTypeArgumentsAsInstanceOf(iterableType as InterfaceType,
|
||||
context.typeEnvironment.coreTypes.iterableClass)!;
|
||||
.getTypeArgumentsAsInstanceOf(
|
||||
iterableType, context.typeEnvironment.coreTypes.iterableClass)!;
|
||||
return typeArguments.single;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,29 +175,18 @@ class RecursiveContinuationRewriter extends Transformer {
|
||||
// }
|
||||
final CoreTypes coreTypes = staticTypeContext.typeEnvironment.coreTypes;
|
||||
|
||||
DartType iterableType = stmt.iterable.getStaticType(staticTypeContext);
|
||||
while (iterableType is TypeParameterType) {
|
||||
TypeParameterType typeParameterType = iterableType;
|
||||
iterableType =
|
||||
typeParameterType.promotedBound ?? typeParameterType.parameter.bound;
|
||||
}
|
||||
|
||||
// The CFE might invoke this transformation despite the program having
|
||||
// compile-time errors. So we will not transform this [stmt] if the
|
||||
// `stmt.iterable` is not a subtype of non-nullable/legacy Iterable.
|
||||
if (iterableType is! InterfaceType ||
|
||||
!staticTypeContext.typeEnvironment.isSubtypeOf(
|
||||
iterableType,
|
||||
coreTypes.iterableRawType(staticTypeContext.nonNullable),
|
||||
staticTypeContext.isNonNullableByDefault
|
||||
? SubtypeCheckMode.withNullabilities
|
||||
: SubtypeCheckMode.ignoringNullabilities)) {
|
||||
return super.visitForInStatement(stmt);
|
||||
// `stmt.iterable` is an invalid expression or has an invalid type and
|
||||
// instead eliminate the entire for-in and replace it with a invalid
|
||||
// expression statement.
|
||||
final iterable = stmt.iterable;
|
||||
final iterableType = iterable.getStaticType(staticTypeContext);
|
||||
if (iterableType is InvalidType) {
|
||||
return ExpressionStatement(
|
||||
InvalidExpression('Invalid iterable type in for-in'));
|
||||
}
|
||||
|
||||
final DartType iterationType = staticTypeContext.typeEnvironment
|
||||
.forInElementType(stmt, (iterableType as InterfaceType));
|
||||
|
||||
// The NNBD sdk declares that Iterable.get:iterator returns a non-nullable
|
||||
// `Iterator<E>`.
|
||||
assert(const [
|
||||
@@ -205,20 +194,21 @@ class RecursiveContinuationRewriter extends Transformer {
|
||||
Nullability.legacy
|
||||
].contains(coreTypes.iterableGetIterator.function.returnType.nullability));
|
||||
|
||||
final iteratorType = InterfaceType(coreTypes.iteratorClass,
|
||||
staticTypeContext.nonNullable, [iterationType]);
|
||||
final DartType elementType = stmt.getElementType(staticTypeContext);
|
||||
final iteratorType = InterfaceType(
|
||||
coreTypes.iteratorClass, staticTypeContext.nonNullable, [elementType]);
|
||||
|
||||
final syncForIterator = VariableDeclaration(
|
||||
ContinuationVariables.syncForIterator,
|
||||
initializer: PropertyGet(
|
||||
stmt.iterable, Name('iterator'), coreTypes.iterableGetIterator)
|
||||
..fileOffset = stmt.iterable.fileOffset,
|
||||
iterable, Name('iterator'), coreTypes.iterableGetIterator)
|
||||
..fileOffset = iterable.fileOffset,
|
||||
type: iteratorType)
|
||||
..fileOffset = stmt.iterable.fileOffset;
|
||||
..fileOffset = iterable.fileOffset;
|
||||
|
||||
final condition = MethodInvocation(VariableGet(syncForIterator),
|
||||
Name('moveNext'), Arguments([]), coreTypes.iteratorMoveNext)
|
||||
..fileOffset = stmt.iterable.fileOffset;
|
||||
..fileOffset = iterable.fileOffset;
|
||||
|
||||
final variable = stmt.variable
|
||||
..initializer = (PropertyGet(VariableGet(syncForIterator),
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
main() {
|
||||
neverForInExpressionType(); //# 01: runtime error
|
||||
}
|
||||
|
||||
neverForInExpressionType() async { //# 01: continued
|
||||
return <int, String>{ //# 01: continued
|
||||
for (var y in throw '') ...y, //# 01: continued
|
||||
}; //# 01: continued
|
||||
} //# 01: continued
|
||||
|
||||
invalidForInExpressionType(X x) async { //# 02: compile-time error
|
||||
return <X, X>{ //# 02: continued
|
||||
for (var y in x) ...y, //# 02: continued
|
||||
}; //# 02: continued
|
||||
} //# 02: continued
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
|
||||
// for details. All rights reserved. Use of this source code is governed by a
|
||||
// BSD-style license that can be found in the LICENSE file.
|
||||
|
||||
main() {
|
||||
neverForInExpressionType(); //# 01: runtime error
|
||||
}
|
||||
|
||||
neverForInExpressionType() async { //# 01: continued
|
||||
return <int, String>{ //# 01: continued
|
||||
for (var y in throw '') ...y, //# 01: continued
|
||||
}; //# 01: continued
|
||||
} //# 01: continued
|
||||
|
||||
invalidForInExpressionType(X x) async { //# 02: compile-time error
|
||||
return <X, X>{ //# 02: continued
|
||||
for (var y in x) ...y, //# 02: continued
|
||||
}; //# 02: continued
|
||||
} //# 02: continued
|
||||
|
||||
Reference in New Issue
Block a user