Override errors on member signatures would point to the synthesized
location (the enclosing class definition) and not the original
member declaration.
Change-Id: If271039f2238f7ae74706e5c4f5143ea6ee4fc1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162750
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Add an initial draft of the widget cache for fast single widget reloads.
THe intention is to capture the common cases where only a single widget class is modified. This can
provide a signal to the flutter tool that a faster reassemble can be performed, rather than forcing
a complete cold frame.
For more details see the linked issue or go/fast-single-widget-reloads
Bug: https://github.com/flutter/flutter/issues/61407
Change-Id: I1c95fd8fb2d1b297f41874dd69c1c76b0456a4bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161604
Commit-Queue: Jonah Williams <jonahwilliams@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
The widget transformer doesn't handle widgets with optional positional
parameters and therefore doesn't provide locations in these cases.
For this reason we leave the location field nullable and don't null check
it on construction.
Close#43371
Change-Id: I2595eb215e8fab477ab0819b70e25d9fb921ed01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162187
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
* Add mechanisms to try out a recovery and only perform it if is
successful.
* Recover written out binary operators, e.g. "a xor b", "a or b" etc.
This fixes#26810 and is also how these operators are written in e.g.
Kotlin. This might be somewhat controversial though.
* Adds a mechanism to _replace_ a token by another token.
This might be controversial.
It is done because just inserting the operator causes the same rewrite
to be attempted on the same token stream several times (at least with
the way the token stream is parsed via the CFE) in turn causing it to
be recovered *sometimes*. This is now avoided by actually replacing
the token.
Change-Id: Icfa806045575d2aa2e5f35126708651b275bcf84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162003
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
InterfaceType's referring to unnamed mixin applications continuously
cause problems for backends since these might not correspond to
types supported at runtime. The LUB specification does not mention
how to handle these so it is valid skip these in the computation of
LUB.
Change-Id: I38f46bf43d5858dec473c26326b741cf36eb57d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145420
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This CL improves recovery in situations like this:
typedef c = foo(int x);
=> recovers like typedef c = foo Function(int x);
typedef d = (int x);
=> recovers like typedef d = Function(int x);
typedef e = foo<F>(int x);
=> recovers like typedef e = foo<F> Function(int x);
typedef f = <F>(int x);
=> recovers like Function<F>(int x);
typedef g = foo<F, G, H, I, J>(int x);
=> recovers like typedef g = foo<F, G, H, I, J> Function(int x);
typedef h = <F, G, H, I, J>(int x);
=> recovers like typedef h = Function<F, G, H, I, J>(int x);
typedef i = <F, G, H, I, J>;
=> recovers like typedef i = Function<F, G, H, I, J>();
And appropriate error messages are given:
"Expected 'Function' before this." and (when inserting parenthesis)
"A typedef needs an explicit list of parameters.".
Fixes#26073.
Change-Id: I368f36f2993033d62b36315198bc993eed74bc92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161485
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This CL also adds fileUri/charOffset to all TypeBuilder's and renames
Void/FutureOr/Never/Dynamic/BuiltInTypeBuilder to *TypeDeclarationBuilder
so match their relation to TypeBuilder/TypeDeclarationBuilder.
Closes#42962
Change-Id: Iee5102134574d24f748103282a37bb9a85a0ac2d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161165
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
I think currently it's marked in the test system (which is why it is not
sad on the bots), but that doesn't help us when running the
incremental_load_from_dill_suite.dart locally.
Change-Id: I0b92b2b30ddb606a96632d6f34ee4c2767cfbeb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161173
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This CL enables textual outline modelling in the incremental compiler,
meaning that the textual outlines created (and compared) to figure out
if we can do a "minimal invalidation" (with the experiment enabled)
is "modelled", i.e. have members, classes etc sorted so that re-ordering
things in a file generally doesn't cause a "transitive invalidation".
Change-Id: I9daddf2bd34e4c2e17b42a5e356033816d05b359
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161172
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
This CL:
* Changes the events so beginX and endX events always comes in pairs
(though technically not right as some specific events can be beginX
endY --- but in those cases it is at least documented and used in code
that actually tests it).
-> This entails adding some events and converting something from
"beginX" to "handleX" instead.
* Adds a utility that can generate an AST of sorts directly from the
parser via a listener using the begin/end matching (and knowing of the
specific ones that doesn't match directly).
* Adds a test that checks that - at least for all tested (50,000+) files
- the AST actually generate "correctly", i.e. matches up begin/ends
and ends up with a single top entry "CompilationUnit".
* Adds a different visualization to the parser listener events by
displaying the "AST directly from the parser" in a UI that can be
navigated. The visualization may not be the best, but it's certainly
a stepping stone.
Change-Id: I9b27f7bbf3be442adc92f357c7b3c46da6f84cf7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159664
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This adds support lowering the encoding of top-level/static fields
with initializers as if they were marked as late fields. This ensures
that LateInitialization is thrown if final fields are written to during
initialization.
Closes#42956
Change-Id: I488fdddd87ebd935a0cdaf82a724e9b87d5f91ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160724
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
The main reason is that this adds better help text when run from
`dart format`. But it includes a couple of other changes and fixes:
* Don't crash when non-ASCII whitespace is trimmed.
* Split all conditional expressions (`?:`) when they are nested.
* Handle `external` and `abstract` fields and variables.
Change-Id: I59326e693bfe538013cd23b58924461f60e8e908
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160981
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Reviewed-by: William Hesse <whesse@google.com>