This CL updates the fasta parser to report three additional
errors in constructor initializers:
* ExpectedAnInitializer
* MissingAssignmentInInitializer
* RedirectingConstructorWithBody
I also added a comment from a discussion about
https://dart-review.googlesource.com/c/sdk/+/39320
Change-Id: Iecb6fe97e3612a11ccc89864a4fc9f353846504c
Reviewed-on: https://dart-review.googlesource.com/40040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
According to Leaf, Dart 2 type inference prefers to infer type
which is asked for, even if a more specific type can be inferred
from arguments.
It means that for
testIterable({"x": 1, "y": 1}.keys, ["x", "y"]);
where
testIterable(Iterable iterable, List expected, [int depth = 0])
the inferred type of map is Map<String, int>, but inferred type
of list is List (as testIterable argument type is List).
So this test is fixed by specifying type arguments of 'expected'
lists explicitly.
Change-Id: I2deab160038ee7abaad587920cb8fc620e09ebdf
Reviewed-on: https://dart-review.googlesource.com/39441
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
I neglected to update this when I removed unnecessary typeNeeded
booleans from the type inference engine
(d031b0aecf).
Change-Id: I08b6ebe14c3c03cbc1480c5139162e997ac24f4a
Reviewed-on: https://dart-review.googlesource.com/39541
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Maybe later extract it into a caching wrapper around AnalysisSession?
R=brianwilkerson@google.com
Change-Id: I0f4c962467c6622bc558f7d9abd318024aec7945
Reviewed-on: https://dart-review.googlesource.com/39920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Also fixes some issues with field initializers; stepping and hover
tooltips should work reasonably now.
Change-Id: I2d0e9e7e14a52ee8c020902f80f835a913f494f3
Reviewed-on: https://dart-review.googlesource.com/39860
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Vijay Menon <vsm@google.com>
for a still unfinalized type argument vector (fixes#31944).
Update status files.
Change-Id: Ib603cd702891dc93775a5fbd09c341bb36922ab3
Reviewed-on: https://dart-review.googlesource.com/39855
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This reverts commit 09eed74a8a.
Reason for revert: Too much SDK code is not yet compliant.
Original change's description:
> Make `void` a static warning to use almost everywhere.
>
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
>
> Added a new set of methods to test the cases.
>
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
>
> Some redundant tests removed.
>
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
>
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>
TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com
Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.
Added a new set of methods to test the cases.
Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.
Some redundant tests removed.
Don't flag: ternaries, void -> void assignments, void returns in
dynamic.
Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
This is the follow-up to 32396138ff
which fixed crash in ClassHierarchy due to ambiguous supertypes.
Change-Id: I53e664574011e5fe67139326ae22aaa90724ea81
Reviewed-on: https://dart-review.googlesource.com/39842
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
This reverts commit 2d4c606e63.
The fix for the debug buildbot breakage now consists of skipping wide to utf8 conversion
altogether, instead move uri to path conversion directly into newly added File::OpenUri method.
Change-Id: Id3d7457d6a6b5045e5f38678548f4d7bed6d2c43
Reviewed-on: https://dart-review.googlesource.com/39801
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
- Enabled incremental compiler in the dart frontend for the command-line VM
- Added method to update in-memory file system with in-memory sources provided by tests
Change-Id: Ica26b7235383185dbb6b4b41064193d432dfcba0
Reviewed-on: https://dart-review.googlesource.com/36126
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Implemented more efficient way to iterate ClassSet in class_hierarchy.dart,
ClassSet becomes Iterable<Class>. This considerably improves speed of
ClosedWorldClassHierarchy.getSingleTargetForInterfaceInvocation() and
CHA-based devirtualization.
Time of CHA-based devirtualization on Flutter Gallery reduced
from ~13.4s to ~1.2s.
Also, ClassHierarchy used in devirtualization is configured to ignore
ambiguous supertypes to avoid crashes on Flutter Gallery.
Change-Id: Iaca251ca268aad3d8bb652247650096f19c25839
Reviewed-on: https://dart-review.googlesource.com/38960
Commit-Queue: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
The covariant parameter related feature specs were written to specify
that overriding admits a type annotation `T` on a formal parameter as
long as `T <: S` or `S <: T` for every type annotation `S` on a
corresponding formal parameter in an overridden declaration (directly
or indirectly).
This CL changes the rules such that a covariant-from-class parameter
must satisfy the standard constraints (contravariance) instead, which
is needed in order to ensure that an important optimization (on self-
sends) is valid.
This makes the spec follow the actual implementation, i.e., the change
will not break any existing software.
Change-Id: Ic871cc16c09220a385d68d9ec32c7a06683db87b
Reviewed-on: https://dart-review.googlesource.com/37664
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
Change-Id: Ibb10a0fcc9a8de33add2ad24a114d45819627f22
Reviewed-on: https://dart-review.googlesource.com/39622
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Change-Id: I09761d12b98864d9a9abcc7abe6f046e45951715
Reviewed-on: https://dart-review.googlesource.com/36642
Commit-Queue: Peter von der Ahé <ahe@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Change-Id: I9ff39eae6cf6bcd9aad59a8320d6a665e480182a
Reviewed-on: https://dart-review.googlesource.com/38580
Commit-Queue: Alexander Thomas <athom@google.com>
Reviewed-by: William Hesse <whesse@google.com>