A<dynamic> is _not_ a subtype of A<int> in Dart 2
Change-Id: I0d1185b38192a06aaf9d8622a78c7384dfc287dc
Reviewed-on: https://dart-review.googlesource.com/52106
Reviewed-by: Sigmund Cherem <sigmund@google.com>
I see however that linter/test/rule_test.dart uses it, but as far as I
can see, that's it. All other usages are from analyzer and
analysis_server.
R=brianwilkerson@google.com
Change-Id: I2b82870a4a4ec6f155326d8ee6dc1c1028f84793
Reviewed-on: https://dart-review.googlesource.com/52265
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
The values returned from calling sync*, async and async* are now parameterised.
Simple cases where the type has no type parameters are handled.
The next step is to introduce a signature-like j-model entity to compute the type in more complex cases.
Change-Id: I2e43088cc6383a70e3a3d3067ec7542694ee2d0a
Reviewed-on: https://dart-review.googlesource.com/51421
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
One thing to be careful of here is that function type bounds may be
left unbounded. However, their parameters and return type cannot refer
to a type parameter for resolve-to-bounds to work.
There are also a large number of ways that this can loop infinitely, and
a number of new guards had to be added (as well as some test cases) to
catch them all.
Change-Id: I14322f5f71d1f7b73b27a870553e5c588b2c7e2e
Reviewed-on: https://dart-review.googlesource.com/52062
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
* when building IL from Kernel use canonical double representation
instead of allocating new double objects;
* in constant propagation canonicalize immutable primitive constants
(strings, mints and doubles) before replacing instruction with its
constant value;
This relands 5909932d38 with the part
that was causing timeouts on flutter_test reverted.
See https://github.com/dart-lang/sdk/issues/32904 for more details.
TBR=aam@google.com
Change-Id: I0c128e44dd6c9689c4b7e9dd91832408214847f3
Reviewed-on: https://dart-review.googlesource.com/51460
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Rename the TypeInfo constants and related constants in preparation
for refactoring and improving type argument and type parameter parsing.
Change-Id: I5a741ee06f373800973942c233490fe83916e39c
Reviewed-on: https://dart-review.googlesource.com/52140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This improves recovery when parsing conditional import expressions
by repositioning the synthetic closing ')' that was inserted by the
scanner in a less than optimal location.
This approach relies on the beforeSynthetic field being set correctly.
While the scanner still sets the 'next' and 'beforeSynthetic' fields
directly for efficiency, most other functions which update an existing
token stream have been revised to call 'setNext()' rather than setting
the 'next' field directly. This ensures that the 'beforeSynthetic' field
will be correctly updated.
Change-Id: Id631fd600c64d1feaf00593acb74a7070e354f07
Reviewed-on: https://dart-review.googlesource.com/52120
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
All fixes are related to the requirement that a concrete class must
implement its entire interface or have a non-trivial noSuchMethod
implementation.
Change-Id: I015e0565e5dd9cfa324c38bb43696e365c58329a
Reviewed-on: https://dart-review.googlesource.com/51880
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
This CL updates SyntheticToken to have a new beforeSynthetic field
and the fasta scanner to set that field for synthetic ")", "]", and "}" tokens.
This makes it much more efficient for the parser to move a synthetic
closer when the scanner has inserted it in a less than optimal location
in the token stream.
This CL also addresses a comment in
Address comment in https://dart-review.googlesource.com/c/sdk/+/51561
Change-Id: I7f056ac25f2ca4cf5edb0ef4bce7f1e9dd76de9a
Reviewed-on: https://dart-review.googlesource.com/52040
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Tests contained erroneously abstract methods and non-abstract classes
that made them not proper Dart 2.
Change-Id: Ie04935f3ffd4aa4e9756048de9668c5481553733
Reviewed-on: https://dart-review.googlesource.com/51845
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Aske Simon Christensen <askesc@google.com>
Makes debug mode more useful.
Change-Id: Iccdb1be03d4abe23424cfb993c566fecb3d74ced
Reviewed-on: https://dart-review.googlesource.com/52021
Reviewed-by: Zach Anderson <zra@google.com>
Previously we would omit a field if it was never the element
in a codegen WorkItem. However, almost all fields fail this test
because field getters are inlined in the optimizer.
Change-Id: I34de218dadb5937885d77dd429237584d1a8be2c
Reviewed-on: https://dart-review.googlesource.com/51581
Commit-Queue: Harry Terkelsen <het@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Make all lists returned by ast_from_binary growable so the ast is more consistent with the ast generated by parsing dart code which generally contains growable lists as opposed to fixed-length lists.
This fixes a bug in the Flutter --track-widget-creation transform
where it would fail on an AST if it was deserialized from a binary file
rather than parsed from source code.
Change-Id: I4e6b199ed98df1b72d8d6844829341975a2c29c9
Reviewed-on: https://dart-review.googlesource.com/51780
Commit-Queue: Jacob Richman <jacobr@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
This CL improves recovery given invalid or malformed formal parameter
types and identifiers. This accomplished by switching the
parseFormalParameter method to use computeType rather than parseType,
improving recovery when parsing field initializers, and in the process,
further reducing the size of parseType and eliminating 6 unused
TypeContinuation elements.
Change-Id: I6f05d8018bf8d9f2c256e5a64408c29db006a8e2
Reviewed-on: https://dart-review.googlesource.com/52000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
'--checked' and '--strong' accidentally lowered []= to HIndexAssign,
in effect removing the check on the parametric covariant argument.
This makes --checked slower for some array-update-intensive
benchmarks.
Change-Id: I8c36e1db15ac6a98e1ec9ca01b2ebdd3effafc1b
Reviewed-on: https://dart-review.googlesource.com/51802
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Our generated code does not keep the context in a special register
anymore (for quite some time now). The context is just another definition
in the IR language and gets assigned register locations by the linearscan
register allocator.
Furthermore we no longer use an empty context for closures which have no
captured states, instead the context of those closures is just `null`.
This CL therefore removes Object::empty_context() and the CTX constant.
Change-Id: Iea171e0d0fd56c48f1c456e08e060a12267e39cc
Reviewed-on: https://dart-review.googlesource.com/51129
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
This CL improves recovery when a type is required to interpret
"Foo.", ".", and ".Foo" as malformed prefixed type references.
When a type is *not* required, each of the above are still interpreted
as no-type-reference.
Change-Id: Ia20caa8619821d24c5b16fd0015cee03987ee2a6
Reviewed-on: https://dart-review.googlesource.com/51900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
The change to vm.dart which turns it on by default will *not* be committed.
Change-Id: Ia3a80ff8e5335aa326f1ffaa9f5c9728ad511b60
Reviewed-on: https://dart-review.googlesource.com/51721
Commit-Queue: Samir Jindel <sjindel@google.com>
Reviewed-by: Régis Crelier <regis@google.com>
Change-Id: Ibce257b802d398612ad03e1d53014b82f9b9c54f
Reviewed-on: https://dart-review.googlesource.com/51881
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Change-Id: I4e54ed7eba5f2af7852faba2cffae12f28e618cf
Reviewed-on: https://dart-review.googlesource.com/51844
Reviewed-by: Erik Ernst <eernst@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Step (1) to flipping the default. When this lands and rolls in, we
can change internal code to explicitly opt-out.
See #32868
Change-Id: Ibd6fc08d6d71b0093decf5667e9b8cdc2b49e3d1
Reviewed-on: https://dart-review.googlesource.com/51444
Reviewed-by: Jenny Messerly <jmesserly@google.com>
Commit-Queue: Vijay Menon <vsm@google.com>