In kernel the loop level wasn't set correctly for for loops, resulting
in the loop variable not always being fresh.
Examples:
```
// Capture the loop variable, ensure we capture the right value.
for (int i = 0; i < 10; i++) { if (i == 7) f = () => "i = $i"; }
print(f());
// There is only one instance of k. The captured variable continues to change.
int k;
for (k = 0; k < 10; k++) { if (k == 7) f = () => "k = $k"; }
print(f());
```
resulted in
i = 10
k = 10
(i.e. it's wrong)
whereas
```
// Capture the loop variable, ensure we capture the right value.
for (int i = 0; i < 10; i++) { if (i == 7) { f = () => "i = $i"; } }
print(f());
{
// There is only one instance of k. The captured variable continues to change.
int k;
for (k = 0; k < 10; k++) { if (k == 7) { f = () => "k = $k"; } }
print(f());
}
```
resultet in
i = 7
k = 10
(i.e. it's correct).
Now both examples produce the correct result.
Change-Id: I1fb4c888c6a0eaa690f62226e093508992b33ed4
Reviewed-on: https://dart-review.googlesource.com/9961
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Previously we got the length of the class' type_parameters().
Now instead we use the class' NumTypeArguments().
Bug:
Change-Id: I3807443765e4926efc17eba54d3bf4f50e8e30c6
Reviewed-on: https://dart-review.googlesource.com/9482
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
- New handleRecoverImport event
for clauses in import directive that are out of order
- New error codes for
Duplicate prefix
Prefix after combinator
Change-Id: I0fea7ad4b4014a0b8578d3982e0515fe85044854
Reviewed-on: https://dart-review.googlesource.com/7980
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL silences several tests for '$compiler = dartkp' configuration
in order to make vm-kernel-precomp-* buildbots greener.
These tests are already silenced for '$compiler = precompiler' or
'$compiler = dartk' configurations.
Change-Id: Ia3208853655868ae4cf39775d40db15218c1a1df
Reviewed-on: https://dart-review.googlesource.com/5286
Reviewed-by: Alexander Aprelev <aam@google.com>
Request particular attention to generic_creation_test and generic_field_mixin6_test, but all of the following required tweaks
to the status files to pass tests:
generic_closure_test
generic_function_bounds_test
generic_function_dcall_test
generic_function_typedef_test
generic_field_mixin6_test
generalized_void_syntax_test
generic_functions_test
BUG=
R=jmesserly@google.com
Review-Url: https://codereview.chromium.org/3008573002 .
Interesting changes:
- A static getter colliding with an inherited non-static setter is a
compile error, not a type warning.
- Trying to call a setter on what is only a getter is a compile error
with no runtime behavior.
- Add support to test.dart for negative tests in DDC.
BUG=
R=jcollins@google.com
Review-Url: https://codereview.chromium.org/3005643002 .
There were tests that tested only checked mode, having their name on the form xx_checked_xx. Those files have been renamed to static.
We found an issue in the DDC regarding constant maps, the issue has been added to the status file.
R=rnystrom@google.com, whesse@google.com
Review-Url: https://codereview.chromium.org/2994383002 .
Other tools had this status entry, but dartk/dartkp were omitted. In
all cases, the change is needed because the allowed usages of `void`
have been relaxed, but most tools do not support that yet.
R=floitsch@google.com
Review-Url: https://codereview.chromium.org/2984273002 .
2. Adjust the Dart front end to not require a 'main' method when the in memory filesystem is used, this allows execution of VM unit tests which all do not necessarily have a 'main' method (integrated CL from siggi)
3. Change kernel reader to not look for a 'main' methos when Dart_LoadKernel is called.
4. Change Dart_LoadScript to also support loading of dart programs when Dart front end is used
R=aam@google.com, sigmund@google.com
Review-Url: https://codereview.chromium.org/2948273002 .
Now kernel-service sends an "error" status whenever there are compile time errors,
so many of these tests that were not executed at runtime are now correctly being
reported by the VM as compile time errors.
This was only possible now that we are plumbing all error messages through a
single API, we can later evaluate whether it makes sense to recover
on some of these errors and how to deal better with recovery
Review-Url: https://codereview.chromium.org/2976403002 .
Currently some tests pass in checked mode but fails in non-checked mode
because we don't check the result of a constant-evaluation that should
be bool in non-checked mode.
This CL changes it so we always check the bool result in the constant-evaluator.
BUG=
R=kustermann@google.com
Review-Url: https://codereview.chromium.org/2956493003 .
Catch simply gave NullConstant as arguments to _instanceOf,
now I've copied what the IsExpression does, and made
LoadInstantiatorTypeArguments actually work in this case
(by filling out the scopes_->this_variable value,
by actually visiting the catch guard in the scope builder
rather than skipping it).
Fixes#29553.
BUG=
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2938173002 .
Before this, if a generic class was instantiated with only dynamic,
TypeArgument::null would be used as the type argument, ignoring
types from the super.
Now it only returns TypeArguments::null if the class directly gives all
type arguments (and they are all dynamic).
Fixes#29537
BUG=
R=kmillikin@google.com
Review-Url: https://codereview.chromium.org/2941983002 .
This mimics the behaviour of the source-based pipeline,
i.e. instead of "manually" calling _AssertionError._create and giving
the correct parameters (wrong parameters, actually), use the helper
method _AssertionError.ThrowNew.
BUG=
R=ahe@google.com, vegorov@google.com
Review-Url: https://codereview.chromium.org/2940283002 .