Commit Graph

5559 Commits

Author SHA1 Message Date
Jens Johansen ac9b4aab8d [parser] More specific error messages when recovering new/const/Map/Set/List with said literals
Follow-up to https://dart-review.googlesource.com/c/sdk/+/190022

Change-Id: Id42336216267dcbf481ae6e111177e6296ea6779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-25 13:27:03 +00:00
Kallen Tu 045813c1f3 [cfe] Asserts for const functions.
Basic assert statements, inline functions in the future. AssertBlocks are not supported with const functions.

Change-Id: Ic831fc4d76db0403a30577b9d00c629237148581
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192800
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-24 16:38:41 +00:00
Kallen Tu 9e5a6c1568 [cfe] Do-while statements for const functions.
Change-Id: I881fb535ef76e564ab76c5fc661d3adbbe5aed0f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192401
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-22 22:19:45 +00:00
Brian Wilkerson 3392632667 Unify three diagnostics for documentation purposes
Change-Id: Id90d4e82d01b59056117c7fc234d8b3a5a8ec7e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192286
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-22 14:44:33 +00:00
Brian Wilkerson 41e00354a3 Unify four diagnostics for documentation purposes
Change-Id: Ifefe90cdbc3ddb9e243a056398b5d8611b3bf22e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192287
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-03-22 14:43:43 +00:00
Leaf Petersen def73d62c6 Fix generic_function_type_argument_test
Change-Id: Ic8e043a25eaefa8852e81fbbb4f40ec4931c0dd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192261
Auto-Submit: Leaf Petersen <leafp@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-03-22 10:41:02 +00:00
Kallen Tu 45c9d8a25e [cfe] Enable recursive function calls for const functions.
Change-Id: Ia164adaf5da313cae4db2b3b326a909e57d8c07c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192200
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-19 17:56:17 +00:00
Nicholas Shahan 453b06d222 [tests] Remove triple shift test skips from status files
There are also skips for these tests in the legacy (*_2) suites.
I'm leaving those as skips because I think they will never be
expected to work since you have to opt into a newer language
version to get the feature.

Change-Id: I1631b1523c6a9be9a14c69c8cf772ea58309c706
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191482
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-03-19 02:32:34 +00:00
Kallen Tu 3c5c1cd3f4 [cfe] Break, continues and labels for const functions.
Change-Id: Id8fce4088042b4acf9eadebe7aa99abd5565a471
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191680
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-18 17:06:13 +00:00
Kallen Tu 7ff1aebc2d [cfe] While loops for const functions.
Change-Id: I7979fa8b50a74f9e423f19805a793a0c25609abd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191580
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-17 16:11:43 +00:00
Kallen Tu 54f8b6fb54 [cfe] Basic for loops for const functions.
Basic for loops with tests, breaks/continues coming in a later CL.

Change-Id: I28f832ef80689a562da99f60d682bf8e4c630697
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191340
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-17 14:53:22 +00:00
Erik Ernst 97e8837f12 Reorganize language/nonfunction_type_aliases/mixed/aliased_cyclic*
This test failed because it had a test outcome expectation comment in
a library which is not the entry point (cf. #44990). This CL changes
the test such that said comment is located in the entry point. The
trade-off is that this test now has a "reverse" import: A library
with null safety enabled imports a legacy library (but, apparently,
this does not cause the test to fail).

PS: This means that we don't have a test that will go green when #44990 is resolved.

Change-Id: Ie94bff22ce75bd662752c5814917e141fafc72ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191365
Reviewed-by: Leaf Petersen <leafp@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-03-17 07:39:21 +00:00
Regis Crelier 33cabf4313 [VM/runtime] Allow generic function types as type arguments in the VM.
Type parameter scopes were not set properly when loading bounds with generic function types from kernel file.
The trail to avoid infinite recursion while comparing type parameter bounds was not used properly.

Fixes https://github.com/dart-lang/sdk/issues/45313
Fixes https://github.com/dart-lang/sdk/issues/45322
Fixes https://github.com/dart-lang/sdk/issues/44930

TEST=regression tests added

Change-Id: I096b7d8c22aa5b3a3a9e12a59b1417388ff5171f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191465
Commit-Queue: Régis Crelier <regis@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
2021-03-17 00:16:41 +00:00
Kallen Tu c906133967 [cfe] Multi-call const function tests to existing behavior.
Change-Id: Id03250e5eeb38d9c69b629c239e573a1d838820f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190980
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-15 18:09:13 +00:00
Kallen Tu a7e5965495 [cfe] If statements for const functions.
Change-Id: If4449eb6613c7a2b53119ed2e8d3f3042624ccd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190800
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-12 21:09:08 +00:00
Jens Johansen 31acdc9d92 [parser] Recovery of of new/const/Map/Set/List with said literals
E.g. recover `Map<int, int>{}` by ignoring the map (i.e. it's
just a literal map), recover `new {}` as just `{}` etc.

Fixes #45251.

Change-Id: I44e67ca6d3b9b068014b8e28822a61063c794d57
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190022
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2021-03-12 10:41:06 +00:00
Kallen Tu 494aaaab39 [cfe] Variable assignments (VariableSet) for const functions.
Change-Id: Iab23493fc09b8fdad78968d905ac8f28e1236aa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190620
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-11 23:14:41 +00:00
Kallen Tu 3210fb4306 [cfe] Environment parents and block tests for const functions.
Fixed up block environment and added tests for them.

Change-Id: I97375c90c9244f6dcf8294dc11b0d4e70697d114
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190320
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-10 15:23:18 +00:00
Kallen Tu d1fd3c6cb6 [cfe] Local functions for const functions.
Change-Id: I9ad3c36c4d515afe1def3f32244dc15b291d4011
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189980
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-03-10 01:07:32 +00:00
Kallen Tu 0ac716d098 [cfe] Variable declarations for const functions.
Change-Id: I085d789125e80dd2b45df9a55f4eaea28c98fd66
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189400
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
2021-03-08 23:34:23 +00:00
Kallen Tu b683098fde [cfe] Execute statements with StatementConstantEvaluator.
Altered the structure of the statement visitors now that ConstantEvaluator is an expression visitor. Currently uses the environment from the prior exprEvaluator, but will change in the future when needed.

No new const functionality, just set up for future ones.

Tests renamed so they actually run now.

Change-Id: Ic5914b0fc700aadeb0dcb28c08593f88e38582a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189220
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-03-06 01:16:26 +00:00
Johnni Winther cdfbac278b [dart2js] Support AssertInitializer in dart2js
Closes #37881

Change-Id: I2606a3cf9bcbc047c58d075585aec01e10e0ea90
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/189200
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Stephen Adams <sra@google.com>
2021-03-05 09:14:37 +00:00
Paul Berry 219fe27e3e Front end: Fix follow-on error arising from ill-typed spread element.
When the CFE encounters an ill-typed spread element in an ambiguous
set/map literal, it replaces it with a synthetic MapEntry object
pointing to an InvalidExpression.  If there is no non-synthetic
MapEntry in the set/map, and it is decided to disambiguate to a set,
then all of the entries are fed into the `convertToElement` method.
Before this CL, this method would see the synthetic MapEntry and
assume the user had explicitly written a key-value pair in a set
literal, so it would try to report the error `Expected ',' before
this` at the location of the `:` in the key-value pair.  But since the
MapEntry was synthetic, there was no `:` and the message was very
confusing.

This CL changes `convertToElement` so that it detects when a MapEntry
has arisen from an error, and avoids creating a follow-on error.

Fixes #45174.

Bug: https://github.com/dart-lang/sdk/issues/45174
Change-Id: I37dc82a130b4bf858b3fb7411bb9c64f7450bd16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188940
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-03-04 15:52:57 +00:00
Kallen Tu bde8bf5e87 Simple function invocations for const functions.
Enable envoking functions that return an already supported expression.

Change-Id: Ie227f274a7dacdd2e4f855c0317200ce41cc1645
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187780
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2021-02-26 18:02:27 +00:00
Erik Ernst 083dd87675 Add test of function types with metadata
This CL extends language/metadata/metadata_location_test.dart with a
couple of extra test cases, covering the situation where the metadata
occurs on a type paramater or value parameter of a function type.

Change-Id: I9b225e8c3d72aa5ddd8893526e65ab4d1b5ab2a9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187922
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-02-26 17:24:07 +00:00
Lasse R.H. Nielsen ab6558280d Generic metadata test.
Change-Id: I4ce9379e32e90229efddb80f97bac88d5bdd21f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185583
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-02-25 18:51:36 +00:00
Erik Ernst 3d48edf1d6 Corrected unintended syntax error in constant_type_literal_test
Change-Id: I186119c2897e2cbbabed20c57cfed8405be7be0a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/187082
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Erik Ernst <eernst@google.com>
2021-02-25 10:42:36 +00:00
Erik Ernst 96ae7b357e Add type alias cyclicity test, with new syntax, generic function types
Change-Id: I3cf5fa5aeaf914951ceea46062c824c9e25ecbd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186290
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-24 13:47:14 +00:00
Regis Crelier ba611b720b [VM/runtime] Dereference top-level TypeRefs type arguments during finalization and hashing.
This fixes https://github.com/dart-lang/sdk/issues/45060

TEST= added regression tests

Change-Id: Ie6e3fd8514ee5b42af1ab5a5c72883c2510da31d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186421
Reviewed-by: Régis Crelier <regis@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-02-24 02:39:27 +00:00
Erik Ernst 822d353256 Update non-function type alias tests
The non-function type alias feature will no longer be supported in
legacy code. This CL moves all the tests on this topic in language_2
to language/nonfunction_type_aliases/mixed. This CL also splits each
of the tests in a legacy part (with @dart and Requirements) and a part
with null safety (containing the non-function type alias declarations
and a bit of code that it depends on), such that we are testing that
non-function type aliases can be used in mixed-version programs, as
long as they are declared in an opted-in library.

Change-Id: Ie1ba3511c95f48d98f6ed7ed56e362895b9d3b19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/184460
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2021-02-23 16:28:20 +00:00
Lasse R.H. Nielsen c589747744 First go at "generic function type as type argument" test.
Flag does not exist yet, so this is completely a thought experiment.

Change-Id: I739c15c92e0b5c3efd46eaea4b09a75f8d287245
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180844
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-02-19 16:12:56 +00:00
Johnni Winther 4f65d69e5e [cfe] Handle duplicate getables and conflicting setables
Change-Id: Iea3cb2d74799f891367c27e1d5a460aa6e7ef803
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183661
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-02-17 07:38:01 +00:00
Sam Rawlins ff6ddd2972 Analyzer: deduplicate errors when operator defined with bad parameters
If an operator declaration has both too many parameters, and one or more
optional parameters, just report the former error.

This is better UX, and is closer aligned to what the CFE reports.

Change-Id: I1f30ab9564f4bcdc49c1f3317add6c55cca29597
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185201
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-02-16 22:39:04 +00:00
Regis Crelier 4d5f027ccb [VM/runtime] Reland: Avoid comparing unfinalized type parameters.
This is done by simplifying the code looking for a type argument vector overlap between class and super class.

This is a reland of reverted https://dart-review.googlesource.com/c/sdk/+/184202
First patchset is the reverted CL.
A check for nullability was missing.

TEST=added regression test for the reland.

Change-Id: I77de3eded631d5223e9335ee9743b95878fe5bd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/185202
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Régis Crelier <regis@google.com>
2021-02-16 22:17:00 +00:00
Lasse R.H. Nielsen d352bc28b8 Remove (most) uses of the "non-nullable" experiment flag.
Since the flag is now enabled by default, there should be no mention of it.
There are still some uses in front_end/testcases that are not just removable
(it also uses `no-non-nullable`). There migth be more uses that are not
as easily found as grepping for `--enable-experiment

Removes two VM tests where fixing them meant they were just duplicating
the corresponding non *_2/ tests.
Fixes #44941

TEST= Large number of tests chaged.=(no-)?non-nullable`.

Change-Id: Ief755981ccde9a5482fcdf408c2929c74433a710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183688
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-02-12 17:16:54 +00:00
Johnni Winther 504d63288e [cfe] Handle setter conflicts
Handle setter conflicts with non-setters and implicit setters.

Closes #44003
Closes #44844

Change-Id: I32c5e4022c187578e2cd37d13151c27451666dbc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/183660
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-02-09 15:56:35 +00:00
Paul Berry 680f5e6da5 Clean up error message nomenclature around metadata vs annotations.
Change-Id: I866900d2c4baca6ee000885f2126de2a97e643ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182800
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-02-08 22:00:04 +00:00
Paul Berry 3bf29dc8ff Test that generic metadata is unsupported inside function bodies.
Currently we don't support generic metadata, but we'll be adding
support soon (https://github.com/dart-lang/language/issues/1297).
When we add it, we'll still want to have tests to make sure that it's
not allowed in older language versions.

The tests we currently have to make sure it's not allowed only test
annotations occurring outside of function bodies, however the front
end code paths for handling code inside function bodies are
sufficiently different that it makes sense to test inside function
bodies too.

Bug: https://github.com/dart-lang/sdk/issues/44838
Change-Id: I846f2fc2e5ae090f21744ed6407b21a48a6d08ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182601
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2021-02-05 20:57:18 +00:00
Clement Skau 2236883ff2 [SDK] Removes non-exiting tests from .status
TEST=Tested all configurations.

Change-Id: Iec00d7e6ea56221ffebcf044de22647907f598f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/182500
Reviewed-by: Tess Strickland <sstrickl@google.com>
Commit-Queue: Clement Skau <cskau@google.com>
2021-02-04 06:46:13 +00:00
Riley Porter cfa35be6f0 [package:js] Added checks for external non-JS members.
Adds static errors in web backends requiring external members to be
annotated with @JS(). Members can be annotated directly, or on the
enclosing class or library.

Also removes duplicate checks in dart2js for non-native external
members that are now covered by the checks on external @JS members.

Change-Id: I2b17456f8f546f80f1ea6a817360c7f4c40f9640
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180442
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Riley Porter <rileyporter@google.com>
2021-02-03 02:14:18 +00:00
asiva 34f9734b41 Revert "[cfe] Handle conditional await in CFE"
This reverts commit 14032a6209.

Reason for revert : Several customer flutter tests are failing because
of the change in behavior.

TEST=revert of previous CL.

Change-Id: Ia235aa93b9c81fbab066803dc0625856f93acceb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181860
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
2021-02-01 23:41:01 +00:00
Dmitry Stefantsov 425e4dbe09 [cfe] Sort type variables topologically before building the bounds
Closes #44455.
Closes #34803.
Closes #42434.

Bug: https://github.com/dart-lang/sdk/issues/44455
Bug: https://github.com/dart-lang/sdk/issues/34803
Bug: https://github.com/dart-lang/sdk/issues/42434
Change-Id: I3be93b0d4a251de79c3bfe9829143f0fbec201ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181402
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-02-01 18:46:29 +00:00
Lasse R.H. Nielsen 60e001acf8 Add tests for the user-definable >>> operator.
Change-Id: I485d8cae7499fd31a69f279c64c3f465241a474d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180843
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-01-29 12:49:46 +00:00
Alexander Aprelev 6b3abe0a98 [vm/concurrency] Add --experimental_enable_isolate_groups_jit flag, make --enable_isolate_groups AOT only.
Issue b/177800357.

TEST=existing test suite
Change-Id: Id6b113932ab7014b8fa6c105845c5c490b60f5e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/181320
Commit-Queue: Alexander Aprelev <aam@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
2021-01-27 17:11:29 +00:00
Paul Berry d4fb6b320c Set BinaryExpression.staticInvokeType properly for extension overrides.
Fixes #43114.

Bug: https://github.com/dart-lang/sdk/issues/43114
Change-Id: Ib0adf67c5ac5189732960a5925d7cdbcff0c4102
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180441
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-01-22 20:53:24 +00:00
Johnni Winther 14032a6209 [cfe] Handle conditional await in CFE
This converts `return e` in async methods in opt-in libraries into

   return let v = e in v is Future<FTV> ? await v ; v

where FTV is the future value type of the enclosing function.

Closes #44395
Closes #44396
Closes #44397
Closes #44399

TEST=existing tests

Change-Id: I59687039bfe4a97ffdaa55ac0f193ca4fb208f44
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175310
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Erik Ernst <eernst@google.com>
2021-01-22 19:12:24 +00:00
Lasse R.H. Nielsen 726904ac17 Add onError extension method to Future.
Provides better typing than `catchError`.

Change-Id: If0d4487b7c3a499160fb719740a1d65c0545024d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151512
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2021-01-21 23:13:56 +00:00
Erik Ernst c9e24eee9f Add test for upper bound with greatest closure
Change-Id: I59d20c1b4c874fb24a67f15296654d54a0d0dc1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/179541
Commit-Queue: Erik Ernst <eernst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-21 08:51:53 +00:00
Sam Rawlins cddd44e1e9 analyzer: Add separate code for concrete implementation override check
Erik wrote a great explanation for this check here:
https://github.com/dart-lang/sdk/issues/37993#issuecomment-757976910

Fixes https://github.com/dart-lang/sdk/issues/37993

Change-Id: I6fb0bd530fac495115314838ec0bb2168d5e9ad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180088
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-01-20 21:27:43 +00:00
Johnni Winther fabf3efda4 [cfe] Refactor ClassHierarchyBuilder to use Tuple for computation
Change-Id: I8055552313786814bde6f66214a013a8bedb2078
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177500
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2021-01-19 19:52:13 +00:00