This also adds the missing vm-kernel opt-counter builder.
Bug: https://github.com/dart-lang/sdk/issues/31753
Change-Id: I0199218f83d227cfc52505c213d7b689acd9c43e
Reviewed-on: https://dart-review.googlesource.com/31984
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
new errors since the parameter type inference logic was changed:
analyzing pkg/analyzer...
error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:174:16 •
inconsistent_method_inheritance
error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:262:16 •
inconsistent_method_inheritance
error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:315:16 •
inconsistent_method_inheritance
error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:467:16 •
inconsistent_method_inheritance
error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:488:16 •
inconsistent_method_inheritance
error • Inconsistent declarations of 'getAncestor' are inherited from
<E>(dynamic) → E, <E extends Element>((Element) → bool) → E at
pkg/analyzer/lib/src/fasta/mock_element.dart:501:16 •
inconsistent_method_inheritance
6 errors found.
Bug:
Change-Id: I48b98e287bd6496b0745a1fcb42f87450cbfba9c
Reviewed-on: https://dart-review.googlesource.com/33180
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
This only works for inlining of dynamic methods. Stubs are not created yet.
Change-Id: Ia138117d503b69774984ce9070a3298b87fdbe78
Reviewed-on: https://dart-review.googlesource.com/32766
Reviewed-by: Sigmund Cherem <sigmund@google.com>
For instance, with the program snippet from issue #31409 one would not
get any other output than the errors, and one would have to explicitly
dump the dill file afterwards to see what was actually generated.
This CL changes this, so the error-library is also printed (in addition
to the, at least in the case of issue #31409, empty list) as in
```
$ pkg/front_end/tool/fasta compile tmp.dart --dump-ir
tmp.dart:2:4: Error: Expected a function body or '=>'.
Try adding {}.
V();
^
tmp.dart:3:5: Error: Duplicated definition of 'V'.
var V;
^
tmp.dart: Error: Duplicated name: 'V'.
tmp.dart:2:1: Error: Duplicated name: V
V();
^
library;
import self as self;
static method #main() → dynamic {
throw "tmp.dart:2:1: Error: Duplicated name: V\nV();\n^";
}
```
Bug:
Change-Id: I8739be43137f098e6dc50df27f4d1d8628bea469
Reviewed-on: https://dart-review.googlesource.com/32602
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
It seems that f99d3628d1
(CL https://dart-review.googlesource.com/33144)
caused these 5 tests to time out on the pkg builder as well as the try
bots.
Locally the tests take ~40 seconds, so giving it a bit more time (i.e.
marking them as slow) seems likely to turn things green again.
Bug:
Change-Id: I90526b1d7060309d8f1cf902bd9d52c71927f1ed
Reviewed-on: https://dart-review.googlesource.com/33340
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Before we used a hack to request resolution information for a single
library as needed, and requested kernels separately. This was hugely
inefficient (but faster to implement as a steel thread). We had then
recompile large library cycles many times, and take just one library.
Before: 480 seconds to compile analyzer (ouch!).
Now: 16 seconds (30 times faster).
Without --previewDart2: 14 seconds.
I will check why it is still slower later.
R=brianwilkerson@google.com, paulberry@google.com
Bug:
Change-Id: Ic3d47684daa74c53f0336523e17b656f26328acf
Reviewed-on: https://dart-review.googlesource.com/33144
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
This reverts commit 60ee2c0dcd.
Reason for revert: Requires https://dart-review.googlesource.com/c/sdk/+/33180 which can land first.
Original change's description:
> Fix#30858, generic function types not serializable when const.
>
> Previously declaring for instance const lists (or even final lists) of
> generic function types ie `final x = <void Function()>[]` would throw
> errors during summarization.
>
> The type parameters don't seem correctly stored yet, but that is an
> edge case. Left a TODO, for now this should go in to prevent the
> analyzer crash.
>
> One thing I changed as well is that `serializeType` assumed it was
> getting a type name, and `serializeTypeName` accepted types but threw
> when it didn't get a type name. I flipped the names so that
> `serializeTypeName` accepts a type name and `serializeType` accepts a
> type in general and decides whether its a type name or a generic
> function type to proceed with specialization.
>
> Bug: 30858
> Change-Id: Id128f8625cbf03bb94d05ff0efdbac3b158e637e
> Reviewed-on: https://dart-review.googlesource.com/20481
> Reviewed-by: Paul Berry <paulberry@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
TBR=paulberry@google.com,scheglov@google.com,mfairhurst@google.com
Change-Id: I6fae28335f7815b1e8c43597fb9451519a13335e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 30858
Reviewed-on: https://dart-review.googlesource.com/33200
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Previously declaring for instance const lists (or even final lists) of
generic function types ie `final x = <void Function()>[]` would throw
errors during summarization.
The type parameters don't seem correctly stored yet, but that is an
edge case. Left a TODO, for now this should go in to prevent the
analyzer crash.
One thing I changed as well is that `serializeType` assumed it was
getting a type name, and `serializeTypeName` accepted types but threw
when it didn't get a type name. I flipped the names so that
`serializeTypeName` accepts a type name and `serializeType` accepts a
type in general and decides whether its a type name or a generic
function type to proceed with specialization.
Bug: 30858
Change-Id: Id128f8625cbf03bb94d05ff0efdbac3b158e637e
Reviewed-on: https://dart-review.googlesource.com/20481
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Test failures introduced by this change have been marked with issue #31616.
Change-Id: Id82a2e850d2d7c3ebcb78b5acb2e59ea3d8da544
Reviewed-on: https://dart-review.googlesource.com/32682
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
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>
Note that the annotation "/*@target=C::aField*/" is duplicated in the
test due to #31790.
Change-Id: Ie3cf2dea7efb9ae46310ee069a588feb37855201
Reviewed-on: https://dart-review.googlesource.com/32862
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This required some changes to analysis_server, since analysis_server
used to have its own version of pumpEventQueue(). Since
pumpEventQueue() is now provided by the test package, I've removed
analysis_server's version, and I've updated some of the call sites to
pass in "times: 5000" to replicate the old analysis_server behavior.
This also required some changes to analyzer, since the fail() method
is now marked as @alwaysThrows, so no code may follow it without
producing a dead code hint.
Change-Id: Ie5ef3a5cc685c18da02de699e59f63f3bb8865f7
Reviewed-on: https://dart-review.googlesource.com/32683
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: 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>
'Normalize' the data used for loading deferred libraries. Replace
URIs and SHA1 hashes with indexes so that the URIs and hashes occur
once.
Bug: https://github.com/dart-lang/sdk/issues/29635
Change-Id: I3ac8791ad44ca588cbb1bd7d86f18243c956a04a
Reviewed-on: https://dart-review.googlesource.com/32505
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@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>
In findMemberName(), native directives need only be skipped for getters,
since other member kinds return as soon as the name is found.
Closes https://github.com/dart-lang/sdk/issues/31738
Change-Id: I57fe50f8564c5b5bbb72c84cad9ce640a24b87b9
Reviewed-on: https://dart-review.googlesource.com/32341
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dan Rubel <danrubel@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>
Blocked by https://dart-review.googlesource.com/c/sdk/+/32447, or else
an invalid syntax error would become a crash.
With this CL and that one, \#31708 is fully fixed.
Bug: 31708
Change-Id: Iac92d1e61e275e43fdb2fe841c2fb0fee4aa155e
Reviewed-on: https://dart-review.googlesource.com/32448
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@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>
We don't grab parsing errors with previewDart2 anymore, because the
same errors are reported during compilation.
R=brianwilkerson@google.com
Bug:
Change-Id: I58dc8c098fe4c8b2009c3adb9cbbbc334a748f61
Reviewed-on: https://dart-review.googlesource.com/32444
Commit-Queue: Konstantin Shcheglov <scheglov@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>
This CL fixes another place where built-in keywords should be allowed
as a prefix. In addition, this CL cleans up some tests and addresses
a comment in https://dart-review.googlesource.com/c/sdk/+/32300
Change-Id: I693b0049fdc47909a5280e1992d1807757495be6
Reviewed-on: https://dart-review.googlesource.com/32420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@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>
This CL fixes/improves 2 keyword contributor situations
when analyzer is using the fasta parser:
* Recover gracefully given a constructor reference
followed by a dot without an identifier
* Include a colon whenever suggesting the 'default' keyword
Change-Id: I393ef16130c7d1288ac4c18e6fdc17dbbe1421ea
Reviewed-on: https://dart-review.googlesource.com/32145
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@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>
This includes two fixes that only caused problems in windows:
- we assumed file-uris in other parts of DDK, and this caused problems with sourcemaps
- we generated module names containing a leading "./" (e.g. "./expect"), this didn't cause trouble in linux, but it is incorrect.
Bug:
Change-Id: Id3c363670544ed0a8373184ec5445549346fc7bf
Reviewed-on: https://dart-review.googlesource.com/31748
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
- and include injected members in ElementEnvironment.forEachLocalClassMember
Change-Id: I90afacf62177fcc5dfd57f23ccc6a7bb5ca4ef37
Reviewed-on: https://dart-review.googlesource.com/31342
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Also added some more tests to the deferred equivalence test.
Bug:
Change-Id: Ia5ca50728a96020ff76b7b519558cdb5847d598e
Reviewed-on: https://dart-review.googlesource.com/31600
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
This reverts commits e122f48257 and b2b902f55a.
Reason for revert: broke ddk in windows, need to investigate proper fix
Change-Id: I5c03bae406f57570cc465aad32610c19ac385944
Reviewed-on: https://dart-review.googlesource.com/31541
Reviewed-by: Sigmund Cherem <sigmund@google.com>
TBR to make the bots green again.
TBR=jakemac@google.com
Change-Id: I5057e41f1974e6a790a37aee4bda00bb6e118f4c
Reviewed-on: https://dart-review.googlesource.com/31520
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This adds the basic support for using the path to the .dill file as a module
name. The main difference between this and Jake's original CL is that we now
hide the multi-root as an implementation detail.
Change-Id: If24af1aaefa5c1445c7c84bd9ff4a7a4d738a320
Reviewed-on: https://dart-review.googlesource.com/31283
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
The fasta parser sometimes "drops" unexpected tokens during recovery.
When this happens, the dropped or skipped token is not reported to
the listeners, and thus does not become part of the analyzer's AST.
These tokens are still in the token stream, but will not be found
by the existing CompletionTarget mechanism.
For example, the fasta parser parses
'if (v i) {}' as 'if (v) {}' and drops the 'i' token.
This CL introduces a new CompletionTarget.droppedToken field.
If a keyword or identifier has been dropped by the parser,
but overlaps the code completion offset, then that token
is placed into this new field.
In the example above, when code completing the 'i',
the CompletionTarget will now be
containingNode = '(v)'
entity = ')'
droppedToken = 'i'
Change-Id: I15e43529ab4a72de9500c521be278fa13ae68d99
Reviewed-on: https://dart-review.googlesource.com/31285
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Also allows us to more generally compare annotations in multi-file tests.
Bug:
Change-Id: I2f4ac34b918cc80400ebc417dfcc2caf56457ac2
Reviewed-on: https://dart-review.googlesource.com/30923
Commit-Queue: Emily Fortuna <efortuna@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Report error when super is used as an expression outside
an initializer. Consolidated some error messages.
Change-Id: Iafaeeeff8a4b72f941925cefcbc832ba47f02a79
Reviewed-on: https://dart-review.googlesource.com/23360
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This updates the KeywordContributor for use with the fasta parser
and cleans up several code completion tests by introducing
a 'usingFastaParser' flag.
Change-Id: Ife2d945065c23ccd9f2d8e85e5c24a6b956c75ae
Reviewed-on: https://dart-review.googlesource.com/30902
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
Change-Id: Ic9d61a19d03ff537d58fa378d992e02de903bad8
Reviewed-on: https://dart-review.googlesource.com/30921
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>