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>
We change the type of FileUriNode.fileUri from String to Uri, which in principle
doesn't change the binary format. However, we did notice that LibraryParts
weren't serialized as specified in binary.md, so we also fixed that.
Since fileUris are stored as strings in a separate table, Uri.parse is only called
once per unique URI.
Fasta only uses relativizeUri when printing diagnostics, and URIs stored in
expectation files (golden files) are relativized using String.replaceAll.
Change-Id: Ib2dc1b80c03a0cdaf84e48b8b3ba73b16bdf8a40
Reviewed-on: https://dart-review.googlesource.com/25421
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Assert initializers in Dart may be compiled directly to this form of initializer,
rather than through local initializers as is done now.
Bug:
Change-Id: Ia149ea3d1df5d1dc18be5636801604ffaf7ca7d8
Reviewed-on: https://dart-review.googlesource.com/14760
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Kevin Millikin <kmillikin@google.com>
At this point KernelDriver is used only by Analyzer, so I don't include
anyone from the FrontEnd team. We will merge to get the same performance
benefits of the latest IKG approach, but later.
Only just enought integration is done - we can store and apply
types in the local variable declaration.
Everything is in disarray, I will follow up with improvements.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: Ie3434e26233b84fb019c50a7cc834a08d0dadbed
Reviewed-on: https://dart-review.googlesource.com/22202
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
For now only getKernel() uses the new compilation method.
There are several new failing tests because redirection factories
are not serialized/deserialized correctly yet (but I saw kernel
support comming for it), and outlines don't include private fields (
which we want to work around by storing just names).
R=paulberry@google.com, sigmund@google.com
Bug:
Change-Id: I0d964862066ac0ee9e7b5c7b1d3802171a874aef
Reviewed-on: https://dart-review.googlesource.com/19440
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Some pain points are:
1. It is a breaking change. I think I will break it even more by removing
FunctionTypeAliasElement altogether.
2. We lose ability to keep track that this FunctionType is instantiation
of a typedef. Just like in Kernel.
3. We sometimes have to look up to see if the GenericFunctionTypeElement
is a function in a named GenericTypeAliasElement.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: Ib250cc446a0ed5b8969f16f7cc6293ef4acf01a8
Reviewed-on: https://dart-review.googlesource.com/9421
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Just `null` almost works, but is not good for default values of
formal parameters. We need a node. In order to unify Kernel and
summary resynthesizers, we now resynthesize to #invalidConst in
both cases.
R=brianwilkerson@google.com
Bug:
Change-Id: Ib353ef51b9393dafaec719ce3f5ca018d73c0f18
Reviewed-on: https://dart-review.googlesource.com/7720
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
I think it should not matter whether we resynthesize unresolved AST
or no AST at all in element model. If constant evaluator knows that
no AST means an error.
With summaries we store unresolved AST and detect that something
cannot be resolved during resynthesis. Hm... Maybe we should stop
in this case and return null, as we do now for Kernel.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: Ie1b5dc3b8910e89087f579145337b900a9e481c7
Reviewed-on: https://dart-review.googlesource.com/7637
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This reverts commit 9a8621b60a.
Revert "Rework getElement() in resynthesizer."
This reverts commit e4fa080f69.
Revert "Create (empty) initializers for parameters resynthesized from Kernel."
This reverts commit 8df6c79b9d.
Revert "Run NonErrorResolverTest in strong mode. Extract not strong tests."
This reverts commit 9bdda4b1d3.
Revert "Move TypeProvider creation into KernelResynthesizer and create loadLibrary functions."
This reverts commit c59eaf1788.
Revert "Return SimpleIdentifier or PrefixedIdentifier from _buildIdentifier()."
This reverts commit 6d0515f9ca.
Change-Id: I1099ca715ce6287ab56808b7cc3abe0589e939c1
Reviewed-on: https://dart-review.googlesource.com/7550
Reviewed-by: Peter von der Ahé <ahe@google.com>