| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/general/for_in_final_variable.dart:7:8: Error: Can't assign to the final variable 'i'. |
| // for (i in [1, 2, 3]) { |
| // ^ |
| // |
| // pkg/front_end/testcases/general/for_in_final_variable.dart:12:8: Error: Can't assign to the final variable 'j'. |
| // for (j in [1, 2, 3]) { |
| // ^ |
| // |
| // pkg/front_end/testcases/general/for_in_final_variable.dart:26:10: Error: Can't assign to the final variable 'i'. |
| // for (i in [1, 2, 3]) 0, |
| // ^ |
| // |
| // pkg/front_end/testcases/general/for_in_final_variable.dart:27:10: Error: Can't assign to the final variable 'j'. |
| // for (j in [1, 2, 3]) 1, |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| static method f() → dynamic { |
| late final dynamic i; |
| { |
| synthesized core::Iterator<dynamic> :sync-for-iterator = core::_GrowableList::_literal3<dynamic>(1, 2, 3).{core::Iterable::iterator}{core::Iterator<dynamic>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final dynamic #t1 = :sync-for-iterator.{core::Iterator::current}{dynamic}; |
| { |
| i = invalid-expression "pkg/front_end/testcases/general/for_in_final_variable.dart:7:8: Error: Can't assign to the final variable 'i'. |
| for (i in [1, 2, 3]) { |
| ^"; |
| late final dynamic i2; |
| i2 = 0; |
| } |
| } |
| } |
| final dynamic j; |
| { |
| synthesized core::Iterator<core::int> :sync-for-iterator = core::_GrowableList::_literal3<core::int>(1, 2, 3).{core::Iterable::iterator}{core::Iterator<core::int>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final core::int #t2 = :sync-for-iterator.{core::Iterator::current}{core::int}; |
| { |
| invalid-expression "pkg/front_end/testcases/general/for_in_final_variable.dart:12:8: Error: Can't assign to the final variable 'j'. |
| for (j in [1, 2, 3]) { |
| ^"; |
| final dynamic j2; |
| j2 = 0; |
| } |
| } |
| } |
| { |
| synthesized core::Iterator<core::int> :sync-for-iterator = core::_GrowableList::_literal3<core::int>(1, 2, 3).{core::Iterable::iterator}{core::Iterator<core::int>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final core::int k = :sync-for-iterator.{core::Iterator::current}{core::int}; |
| { |
| final dynamic k2; |
| k2 = 0; |
| } |
| } |
| } |
| } |
| static method g() → dynamic { |
| late final dynamic i; |
| final dynamic j; |
| core::List<core::int> l = block { |
| final core::List<core::int> #t3 = core::_GrowableList::•<core::int>(0); |
| { |
| synthesized core::Iterator<dynamic> :sync-for-iterator = core::_GrowableList::_literal3<dynamic>(1, 2, 3).{core::Iterable::iterator}{core::Iterator<dynamic>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final dynamic #t4 = :sync-for-iterator.{core::Iterator::current}{dynamic}; |
| { |
| i = invalid-expression "pkg/front_end/testcases/general/for_in_final_variable.dart:26:10: Error: Can't assign to the final variable 'i'. |
| for (i in [1, 2, 3]) 0, |
| ^"; |
| #t3.{core::List::add}{Invariant}(0){(core::int) → void}; |
| } |
| } |
| } |
| { |
| synthesized core::Iterator<core::int> :sync-for-iterator = core::_GrowableList::_literal3<core::int>(1, 2, 3).{core::Iterable::iterator}{core::Iterator<core::int>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final core::int #t5 = :sync-for-iterator.{core::Iterator::current}{core::int}; |
| { |
| invalid-expression "pkg/front_end/testcases/general/for_in_final_variable.dart:27:10: Error: Can't assign to the final variable 'j'. |
| for (j in [1, 2, 3]) 1, |
| ^"; |
| #t3.{core::List::add}{Invariant}(1){(core::int) → void}; |
| } |
| } |
| } |
| { |
| synthesized core::Iterator<core::int> :sync-for-iterator = core::_GrowableList::_literal3<core::int>(1, 2, 3).{core::Iterable::iterator}{core::Iterator<core::int>}; |
| for (; :sync-for-iterator.{core::Iterator::moveNext}(){() → core::bool}; ) { |
| final core::int k = :sync-for-iterator.{core::Iterator::current}{core::int}; |
| #t3.{core::List::add}{Invariant}(2){(core::int) → void}; |
| } |
| } |
| } =>#t3; |
| } |