The classes Future and Stream are exported by dart:core.
By attempting to look up FutureOr in dart:core before dart:async,
we support simple a simple test scenario where there's only one
platform library.
Change-Id: I76627f89957b91fbdb52a7772c177a769c37cecb
Reviewed-on: https://dart-review.googlesource.com/c/90381
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This achieves consistency with similar getters in the API.
This is technically a breaking change, since it changes a published
part of the Kernel API. Since the constants API is relatively new and
so far only used internally in the AOT compiler, the change is
expected to be unproblematic.
Closes https://github.com/dart-lang/sdk/issues/35696
Change-Id: I3ca30922580d226ccbdb6f77496983c21ef2102b
Reviewed-on: https://dart-review.googlesource.com/c/90220
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
When there is an invalid expression in a constant expression, stop
constant evaluation. The value of that constant expression is the
first invalid subexpression it encountered. This stops us from trying
to constant fold invalid expressions.
Clean up status files for the co19 constant-update-2018 tests to
remove duplication.
Change-Id: Ie6c87f4782ada65fb4d822ad9bf41aedfe0afc45
Reviewed-on: https://dart-review.googlesource.com/c/90040
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Calls to the factory constructor 'new List' can turn into static
invocations of a backend-specific factory function. Signal an error
instead of crashing.
Change-Id: Id0a8a7f0f847c03225b7fa9da2351032d15522e0
Reviewed-on: https://dart-review.googlesource.com/c/90006
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>
An invalid constant is (currently) represented by an unevaluated
invalid expression. Using this instead of null fixes 63 out of 125
CFE constant-evaluation crashes with constant-update-2018 and
correctly signals 26 more previously-missed compile-time errors.
Change-Id: I5b4de3995b3a59978dfa08fc542ef0f027572eb6
Reviewed-on: https://dart-review.googlesource.com/c/89506
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Fasta allows some non-const static field access in constant contexts
which leads to the constant evaluator trying to evaluate them. Signal
an error instead of crashing. This will double-report errors for the
cases that Fasta already catches, and we should fix that
double-reporting.
Fix unbounded recursion in printing unevaluated constants (writeNode
called visitUnevaluatedConstant which called defaultConstant which
called writeNode...).
Fix a spurious trailing comma in printing of instance constants.
Change-Id: Idff3169a3a56432ad67c27ff9c267ef355c4c1dc
Reviewed-on: https://dart-review.googlesource.com/c/89514
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Instead of simply printing a message, properly signal a Fasta problem for
constant errors. This causes 68 tests (presumably missing compile-time
errors) to start passing with --enable-experiment=constant-update-2018.
Change-Id: Ia9f1809305bbef7b4652ce49acf6fb9c18408207
Reviewed-on: https://dart-review.googlesource.com/c/89580
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Make the constant evaluator take an explicit error reporter so we have
to opt in to using the "simple" one that reports errors in an ad hoc
way. This is the start of a change to use Fasta-controlled error
messages throughout and eventually get rid of the simple error
handler, and to continue constant evaluation after the first constant
error.
Change-Id: If6b1801edab6063754b642cf4a603abf9d63103a
Reviewed-on: https://dart-review.googlesource.com/c/89501
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
These can arise in erroneous cases which have already been reported,
e.g., in a for-in loop with a const declaration. The constant
evaluator should not assume a non-null initializer in this case.
Change-Id: I2540cb9c659d33e23b6c00d4a8bbf56c404d8c1d
Reviewed-on: https://dart-review.googlesource.com/c/89280
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Auto-Submit: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
Add Kernel syntactic support for constants constructed by
bool.fromEnvironment, int.fromEnvironment, and String.fromEnvironment.
These values are not necessarily available at compile time. Because
constants can depend on these values, there is also an unevaluated constant
that represents an expression depending on environment values.
This syntax is not yet produced by the Fasta compiler.
Change-Id: Ie96ea7f60a7efcd35ac802b320a00f398d41232e
Reviewed-on: https://dart-review.googlesource.com/c/88827
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Aske Simon Christensen <askesc@google.com>
This will enable serialization of expressions blocked on names.
Supporting private names requires a map from from serialized library
ID to library. More generally, we need to support something like the
dill file's canonical names.
Change-Id: I7d470e6a49b167f7755d130ea6c3e543e188da65
Reviewed-on: https://dart-review.googlesource.com/c/88703
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Daniel Hillerström <hillerstrom@google.com>
Commit-Queue: Kevin Millikin <kmillikin@google.com>