Reland of https://dart-review.googlesource.com/c/sdk/+/29160
Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.
A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.
Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.
Closes https://github.com/dart-lang/sdk/issues/31286
Change-Id: Id3b3b7f1fc6a101639fc908c90f3ec7d304a7b4b
Reviewed-on: https://dart-review.googlesource.com/32580
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This reverts commit ab229b30ef.
Reason for revert: Failing co19 test
Original change's description:
> Improve fasta field recovery
>
> In addition to improving field recovery, this CL
> fixes class field recovery to include an endMember event event
> and cleans up missing class body recovery.
>
> Change-Id: I53afe5aef55452108803388de9245f7e14f97833
> Reviewed-on: https://dart-review.googlesource.com/32820
> Commit-Queue: Dan Rubel <danrubel@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
TBR=brianwilkerson@google.com,danrubel@google.com
Change-Id: Id2976bfe67b410875a912bbfd6bfcbbe3d3c8c75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/32840
Reviewed-by: Dan Rubel <danrubel@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
In addition to improving field recovery, this CL
fixes class field recovery to include an endMember event event
and cleans up missing class body recovery.
Change-Id: I53afe5aef55452108803388de9245f7e14f97833
Reviewed-on: https://dart-review.googlesource.com/32820
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The constant collector was inconsistent with the old frontend: we were
skipping primitives and we were not going into the body of closures.
Change-Id: I3321426da7e684d203f0ac7a2a2c7028f3138a7b
Reviewed-on: https://dart-review.googlesource.com/32663
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Emily Fortuna <efortuna@google.com>
Also adds this to the build script, so we can eventually replace the existing SDK compile step with this new one.
Change-Id: Iba0720df5bbab302d2fdd0b5aeeb182de152cc98
Reviewed-on: https://dart-review.googlesource.com/32504
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
these tests on by default yet because of an issue in the stacktrace
package (see issue 31764)
Change-Id: Ifeb5dc4fc85e7d83b3011948133ce6d2a1998248
Reviewed-on: https://dart-review.googlesource.com/29480
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Dart 2.0 fixed-size integers are enabled in Dart VM in all modes.
Status of legacy tests is updated.
This CL includes ff9fc413a7 with fixes.
Change-Id: I632d8177e9d07cd82ecea75ab6c325681b3a25c9
Reviewed-on: https://dart-review.googlesource.com/32443
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Looks like the best place to put this is in the type builder, which has
special logic for foreaches. Previously, that special logic did not
include a need to visit the type, but with [GenericFunctionType]s, its
now necessary.
New test added; fails with kernel.
Bug: 31708
Change-Id: I6536be816a84458cf81d9037289ce6415ed13985
Reviewed-on: https://dart-review.googlesource.com/32447
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Test failures introduced by this change have been marked with issue #31616.
Change-Id: Iddbcedb972b5ad2cf12e3fe588bd38aec76816df
Reviewed-on: https://dart-review.googlesource.com/29742
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Dart 2.0 fixed-size integers are enabled in Dart VM in all modes.
Status of legacy tests is updated.
Change-Id: I967a413c0b81eb92cf6be78ad3ee324798288bd2
Reviewed-on: https://dart-review.googlesource.com/31406
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Adds a 'severity' field to diagnostic messages and replaces all
addWarning and addNit functions by a generic addProblem, which uses
the intrinsic severity of the message. Eventually, errors should
also be reported this way.
A special severity value maps into either warning or error for Dart 1
and Dart 2, respectively. Most Dart 1 warnings are in this category.
Fixes some 320 failures of DDK test expecting a compile-time error.
These were previously masked by a workaround in the DDC error handler
which has now been removed.
Closes https://github.com/dart-lang/sdk/issues/31286
Change-Id: I6acea31b8cba7dec8b318e081d28f4eb4ebbf75c
Reviewed-on: https://dart-review.googlesource.com/29160
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Before: Kernel static errors were represented by throwing a distinguished
error or else by calling a distinguished library const constructor.
Now: Kernel static errors are represented by InvalidExpression. To support
error reporting, InvalidExpression has an optional message and a file
offset. A back end can choose to signal these errors at any time; for
example, when deserializing the binary, or when compiling the procedure
containing the static error, or when the erroneous expression is evaluated
at run time.
InvalidStatement is removed because it can be encoded as ExpressionStatement
of InvalidExpression.
Future work:
* supporting static errors where an expression cannot appear in the AST
* allowing InvalidExpression to contain an Expression for error recovery
* adding a top-level list of static errors and warnings to the binary
Bug: https://github.com/dart-lang/sdk/issues/29840
Change-Id: Ifdfe9a76cee6cefed28061bf245be70531d2f413
Reviewed-on: https://dart-review.googlesource.com/31320
Commit-Queue: Kevin Millikin <kmillikin@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I ended up fixing this bug during my refactoring to support
deferred-constant-values in kernel (1ddb7db237).
The issue was that ssa/builder.dart was using the output unit of the deferred
import instead of the output unit of the deferred constant field.
(fixes#31306)
Bug: https://github.com/dart-lang/sdk/issues/31306
Change-Id: I557983c5ec85f2aa6adb486961dd2f79852e8d5a
Reviewed-on: https://dart-review.googlesource.com/32201
Reviewed-by: Stephen Adams <sra@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Start by adding static castTo method to the interfaces. This provides everybody with the
desired implementation without exposing the classes.
When implementing the cast method, the recommended way is to (extend the base class,
but if you choose not to ...) use the castTo method.
If we ever get a language feature, we can implement the castTo method using that,
without being stuck with an unnecessary class.
Change-Id: I53274e60c88a4de519bead85d2ca44c1065a9c1a
Reviewed-on: https://dart-review.googlesource.com/26620
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
+ support generic type variable type literals
+ support generic type variable is test
Change-Id: I2473c39c33940c631070b919c7dcfe712fd1fe3d
Reviewed-on: https://dart-review.googlesource.com/31783
Reviewed-by: Stephen Adams <sra@google.com>
Addresses the performance concern raised in #31746
Change-Id: Iabfb4b871fb7807c0fe625036adfd22d2e6c51ee
Reviewed-on: https://dart-review.googlesource.com/31751
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Also, updated status files to correctly fix failures in FF, IE and removed other spurious status entries.
R=alanknight@google.com,vsm@google.com
Change-Id: Ic965103d892ff4d5d119712e3187e829f57cd022
Reviewed-on: https://dart-review.googlesource.com/31800
Reviewed-by: Terry Lucas <terry@google.com>