Sigmund Cherem
4b7d256a06
Revert "Enable constant-update-2018 by default." and "Update .expect files in pkg/front_end after e9ca6a53"
...
This reverts commit e9ca6a5335 and d3e00fd35e .
Change-Id: I346d6156be19c4fceffa202a7ce9bfa931c7c14b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99560
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Reviewed-by: Vijay Menon <vsm@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
2019-04-16 20:20:12 +00:00
Sigmund Cherem
f175b0baf8
Report errors for using control-flow and spread features in a const context
...
CFE detects the const context while parsing, so we can report the error message
early on before we do any transformations.
Change-Id: Ib1cadb28366eb6a9a18612206aa155b04a4a5b32
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99540
Commit-Queue: Sigmund Cherem <sigmund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-16 19:50:55 +00:00
Dan Rubel
80dd5ca3d4
new "modifier out of order" error code
...
This replaces the const-after-factory error code
with a more general modifier-out-of-order error code.
Change-Id: I71baf2c96656241475c344cb33b887d8e0d456fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2019-04-16 19:28:55 +00:00
Johnni Winther
5af34ea93d
[CFE] Handle invalid constant string interpolation in unevaluated constant expressions
...
Non-primitive constants were incorrectly stringified in an unevaluated
context. These are now, as with unevaluated constants, checked when the
string concatenation is fully evaluated.
Closes #36609
Change-Id: Ia3266ebcb9d497b277690244569812f7cd3e30c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99461
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Commit-Queue: Sigmund Cherem <sigmund@google.com >
Auto-Submit: Johnni Winther <johnniwinther@google.com >
2019-04-16 16:05:05 +00:00
Kevin Millikin
e42a8032fb
[cfe] Remove uninferred initializers from outlines
...
When performing top-level type inference based on overrides for fields
that have initializers, we never perform type inference for the
initializers. Since type inference is the thing that rewrites shadow
AST nodes with their Kernel translation, we are left with
untransformed shadow nodes that cannot be serialized.
Instead, remove these initializers. Fixes
https://github.com/dart-lang/sdk/issues/36498
Change-Id: I044fadd897e9f2d0e37f5ce0e5adaadb0e42a992
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99120
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2019-04-15 16:17:35 +00:00
Dmitry Stefantsov
4b42f87971
Remove unused import
...
Change-Id: I48175f0eecbd53fbe0c02b70c0a5f4d27ba88764
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99155
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2019-04-15 15:45:24 +00:00
Paul Berry
22a843a23d
Fix precedence of postfix "!" operator
...
Change-Id: I00446e15cd7e19285b35742a1936c36b1faf4774
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99282
Reviewed-by: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-13 16:20:22 +00:00
Paul Berry
f3dbfee467
Fix the error message template for EXPERIMENT_NOT_ENABLED.
...
Given an experiment named foo, it doesn't make sense to ask the user
to enable experiment --foo, since that's not the syntax for enabling
an experiment (the syntax is --enable-experiment=foo). Changed to
'foo'.
Change-Id: I055461fb389a4338578fc7f260e252b8e3fe9a13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99286
Reviewed-by: Dan Rubel <danrubel@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2019-04-13 16:19:23 +00:00
danrubel
2e7bd1359d
parse dart language version comment
...
This updates the parser to recognize a language version comment
of the form
// @dart = <major>.<minor>
as specified in
https://github.com/dart-lang/language/blob/master/accepted/future-releases/language-versioning/language-versioning.md#individual-library-language-version-override
Change-Id: I884620ac7da86025f5b408bcba8dd1f77e4c523c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99261
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-13 13:09:22 +00:00
Aske Simon Christensen
e9ca6a5335
Enable constant-update-2018 by default.
...
Fixes https://github.com/dart-lang/sdk/issues/32517
Fixes https://github.com/dart-lang/sdk/issues/34189
Fixes https://github.com/dart-lang/sdk/issues/34192
Fixes https://github.com/dart-lang/sdk/issues/34205
Unskipping the skipped tests is tracked by
https://github.com/dart-lang/sdk/issues/36433 and
https://github.com/dart-lang/sdk/issues/36595 .
Expectation files for front-end tests will need to be updated to make
front-end builders green. They are part of unapprovable suites.
Change-Id: I311f449af6feff5bf40740227a95aa06e0a9d84f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99169
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2019-04-12 13:30:15 +00:00
Aske Simon Christensen
4ed24862ee
[CFE] Extra dummy SDK classes that the constant evaluator needs.
...
Change-Id: Ib82db42686f5b075e7c3a282e7c370849c4c28e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99167
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Auto-Submit: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2019-04-12 11:03:11 +00:00
Aske Simon Christensen
a3d13fbf54
[CFE] Option to report error on unevaluated constants.
...
Fixes https://github.com/dart-lang/sdk/issues/36565
Change-Id: I011e4b5242a02e06392af01ad77615c694fb62ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99121
Auto-Submit: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Siva Annamalai <asiva@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2019-04-12 08:15:57 +00:00
danrubel
5dd89ef9a0
fix invalid var init parser recovery
...
Fix https://github.com/Dart-Code/Dart-Code/issues/1548
Change-Id: Ib593c17fa8dfcee3c8ad139b72ceff56497d43a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99093
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2019-04-11 18:42:02 +00:00
Aske Simon Christensen
f7ad0c4de8
[CFE] Avoid spurious circularity error when an error is evaluated again.
...
Fixes https://github.com/dart-lang/sdk/issues/36563
Change-Id: Ic078ad1f380ee92513948c5f85560db3c6a2941f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99163
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Auto-Submit: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
2019-04-11 13:45:14 +00:00
Jens Johansen
f919c3985b
Proper offstes on mixin classes
...
Change-Id: I1e7fcdae5713e8017aaf81e87afba20e59b9f789
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98338
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-11 12:32:44 +00:00
Jens Johansen
7f3ced4333
Set proper startCharOffset on enum classes
...
Change-Id: I2edf7b5484e4c0fc9728644c5e1166fb3adcd909
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98353
Reviewed-by: Kevin Millikin <kmillikin@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2019-04-11 12:20:44 +00:00
Jens Johansen
6609ea21e2
Proper endoffset on enum classes
...
Change-Id: Ia6e04b8f84dbe9600d7d9a7fab17cb25e8c5a170
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98345
Reviewed-by: Kevin Millikin <kmillikin@google.com >
Commit-Queue: Jens Johansen <jensj@google.com >
2019-04-11 12:19:44 +00:00
Sigmund Cherem
5cc9455b65
scanner-tool: add explicit command-line arguments to enable printing tokens
...
This will be used instead of -DprintTokens=true.
Context: we use this tool in bazel where we use a modular pipeline. That
pipeline will no longer support dart environment variables due to
https://github.com/dart-lang/sdk/issues/36513 .
In this specific file the intent was anyways to pass an option when
launching the program, so a command-line option is appropriate IMO.
Change-Id: I5187190a01afe59aef57ec6a7311b1e380313a81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99102
Reviewed-by: Ari Aye <ariaye@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Sigmund Cherem <sigmund@google.com >
2019-04-10 22:57:04 +00:00
Mayank Patke
ab66a3808b
Add more JS subtyping semantics to CFE constant evaluator.
...
If we're targeting a JS backend, `isSubtype` considers every int to be a
double. We need to additionally allow any integer-valued double to be an
int. This mainly allows us to handle signed zeroes correctly.
Fixes https://github.com/dart-lang/sdk/issues/36562 .
Change-Id: I00d1e693bb3f1268ac100a76c9bec8fcc612b182
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/99101
Commit-Queue: Mayank Patke <fishythefish@google.com >
Reviewed-by: Sigmund Cherem <sigmund@google.com >
2019-04-10 21:09:03 +00:00
Kevin Millikin
ac02811081
[cfe] Allow expression compilation with constant-update-2018
...
Allow expressions to be compiled by the VM but without evaluating
constants. This will use the VM's C++ constant evaluator.
Fixes https://github.com/dart-lang/sdk/issues/36479
Change-Id: Icd6e769e53db5d211a083d1f5cff7ddf88cc4da2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98675
Commit-Queue: Kevin Millikin <kmillikin@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-10 14:13:56 +00:00
Dmitry Stefantsov
4ab4545ff7
[cfe] Add type and file offset to constant expressions
...
Closes #36471 .
Bug: http://dartbug.com/36471
Change-Id: I5ac294057f2f69f1a8edfdf1106f65908fc257ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98677
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Vyacheslav Egorov <vegorov@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-10 09:55:36 +00:00
Dmitry Stefantsov
1daac5c976
[cfe] Do the requested clean-up after implementing ui-as-code features
...
Change-Id: Ife3f816ca67ef3f43c13abd5563181ed29d05ed2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98668
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-09 11:37:28 +00:00
Vijay Menon
94baf382cc
Revert "Revert "set empty environment defines to CompilerOptions""
...
Per our internal discussion, we need this afterall: see b/129881700
Change-Id: I2c1deebaa68640944fa83df1850be0dce40b188f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98805
Auto-Submit: Vijay Menon <vsm@google.com >
Reviewed-by: David Morgan <davidmorgan@google.com >
Commit-Queue: Vijay Menon <vsm@google.com >
2019-04-08 14:15:53 +00:00
Aske Simon Christensen
d75a49a44f
[CFE] Ignore abstract methods when looking for operator '=='.
...
Fixes https://github.com/dart-lang/sdk/issues/36515
Change-Id: I7e6717b8cde7341c482e5eeb52c2ab4fe8fdcb9c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98842
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Auto-Submit: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-08 11:11:08 +00:00
Aske Simon Christensen
6dc9c8d127
[CFE] JS: Treat integer valued double constants as integers.
...
This fixes the problem with two-pass constant evaluation (with
intervening serialization) where an integer created by the first
pass would look like a double to the second pass.
Fixes https://github.com/dart-lang/sdk/issues/36477
Change-Id: I5040c3a2dac780c17a28b29df3dd65b6b9b3379b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98676
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2019-04-05 15:56:04 +00:00
Jacob MacDonald
44799241fa
Revert "set empty environment defines to CompilerOptions"
...
This reverts commit 3d6e29d251 .
Change-Id: Id4760ef320e26552629d6795b6faa630bf5e15dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98697
Auto-Submit: Jake Macdonald <jakemac@google.com >
Reviewed-by: David Morgan <davidmorgan@google.com >
Commit-Queue: David Morgan <davidmorgan@google.com >
2019-04-05 14:57:14 +00:00
Jacob MacDonald
3d6e29d251
set empty environment defines to CompilerOptions
...
Bug: https://github.com/dart-lang/sdk/issues/36476
Change-Id: I5fac7372026acbb9ef1d9514e6518088ee18dcfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98702
Auto-Submit: Jake Macdonald <jakemac@google.com >
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
Commit-Queue: Keerti Parthasarathy <keertip@google.com >
2019-04-04 20:38:18 +00:00
Aske Simon Christensen
313e0f5410
[CFE] Check if set element or map key overrides operator '=='.
...
Fixes https://github.com/dart-lang/sdk/issues/36444
Change-Id: I38b485ca538c65072e2ec3386e30c5ce49671fe4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98666
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-04 14:39:50 +00:00
Brian Wilkerson
e58a8fade5
Fix typos in the diagnostic messages
...
Change-Id: I65a11e52933c37a63cb9d0a14b1961a20e16271f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98600
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2019-04-04 13:47:40 +00:00
Aske Simon Christensen
a069ddda21
[CFE] Produce InstanceCreation from unevaluated constructor invocation.
...
Thread assert enable flag through in dart2js to make the dart2js cfe
constant evaluation unit test properly pass the flag.
Fixes https://github.com/dart-lang/sdk/issues/36454
Change-Id: Ie4ac86ce96feda1548120fed54ece9ca03387496
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98570
Commit-Queue: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-04 12:22:50 +00:00
Mayank Patke
2f77af1c6f
Fold identical(double.nan, double.nan) => false in dart2js.
...
Change-Id: Idc6b064e330af71bbc8525a48874d332d84f404a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98607
Reviewed-by: Sigmund Cherem <sigmund@google.com >
Reviewed-by: Stephen Adams <sra@google.com >
Commit-Queue: Mayank Patke <fishythefish@google.com >
2019-04-03 21:14:31 +00:00
danrubel
fe2d66006d
improve type-before-factory error message
...
Address comment in https://dart-review.googlesource.com/c/sdk/+/98449
Change-Id: I38e7cf04e2061dbd6c9b37cca713e8420a1e021d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98520
Commit-Queue: Dan Rubel <danrubel@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2019-04-03 16:30:18 +00:00
Dmitry Stefantsov
9f3e9f37a0
[cfe] Make checks on individual leaves of collection element sub-trees
...
Closes #36456 .
Bug: http://dartbug.com/36456
Change-Id: Ic604fecbabe78eede44cedb2251a68b71f608c41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98567
Auto-Submit: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2019-04-03 13:54:03 +00:00
Kevin Millikin
54783db99c
[cfe] Ensure that await for elements are marked async
...
When converting an await for map entry to an element, ensure that the
element is properly marked async. This fixes failures on dart2js and
DDK.
Change-Id: I7566bc57728f1d734bb8932f15ea7a9e9487d39e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98565
Auto-Submit: Kevin Millikin <kmillikin@google.com >
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com >
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
2019-04-03 12:54:33 +00:00
Kevin Millikin
dbb6bf0237
[cfe] Ensure that async for map entries are marked
...
When disambiguating between maps and sets, ensure that `await for`
loops are marked as asynchronous. Otherwise, there will be a spurious
type error because we have a Stream and would expect an Iterable.
Change-Id: Ie97eaf74ff7a9e4dfb262ab0447f4322d04701aa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98467
Commit-Queue: Kevin Millikin <kmillikin@google.com >
Auto-Submit: Kevin Millikin <kmillikin@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-03 10:27:22 +00:00
Dmitry Stefantsov
e1e5bb59c9
[cfe] Check that the condition in if-elements is a bool
...
Change-Id: If089fa603d586169ca2a368ba7fbf7fffc7ec8d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98484
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-03 09:17:24 +00:00
Dmitry Stefantsov
c5f1614bcc
[fasta] Don't use invalidCollectionElement when ui-as-code is enabled
...
Closes #36413 .
Bug: http://dartbug.com/36413
Change-Id: Ie9f0b82bab63c802fddb4c5642d374d7cc43455e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98466
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-03 09:17:24 +00:00
Mayank Patke
335a854696
Implement JavaScript semantics for frontend constant folding.
...
Change-Id: I8232d0f5875d8471d8110582c44fc9d9b8a735f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98240
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-02 22:37:46 +00:00
danrubel
725c070632
report error on type reference before factory keyword
...
This updates the parser to report an error if there is a type reference
preceding the factory keyword.
Fix https://github.com/dart-lang/sdk/issues/36400
Change-Id: Iba04f68bba8d260444d55168322d67a600feba53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98449
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Dan Rubel <danrubel@google.com >
2019-04-02 15:39:29 +00:00
Johnni Winther
14fd3b7d6a
Report errors on invalid constants in == and !=
...
Invocation of == and != is only constant on receivers of types bool, int, double, and String or null operands. This is now handled correctly in constant evaluation. The case for method invocation of `a != b` is removed since it is parsed as `!(a == b)`.
Change-Id: I65d8ddf2716f319f61fc0609803a5237f4aba644
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98349
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-02 13:54:28 +00:00
Dmitry Stefantsov
4a1b153fe1
[cfe] Enable type promotion in if-elements of literal collections
...
Closes #36396 .
Bug: http://dartbug.com/36396
Change-Id: I223267cdee1aca38d69354e4f97df7dcc76e9553
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98461
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-02 13:33:19 +00:00
Dmitry Stefantsov
45bd79c119
[cfe] Fix inference on variable declarations in for-elements
...
Closes #36395 , closes #36393 .
Bug: http://dartbug.com/36395
Change-Id: Ifd35ce2e1a646b484b7fcc83d9fb1a0f9d3ae978
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98333
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-02 13:33:19 +00:00
Dmitry Stefantsov
71a3649a5a
[cfe] Assume invocations are dead if they aren't reached by type inference
...
Closes #36356
Bug: http://dartbug.com/36356
Change-Id: I8fdc50877ada3eaa608bd8b02d53dc975af4efd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98355
Commit-Queue: Dmitry Stefantsov <dmitryas@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-02 13:08:09 +00:00
Aske Simon Christensen
d320f42542
[CFE] Remove redundant null checks in constant evaluator.
...
The evaluate method now never returns null, so checks for null of
return values are redundant, and the "try" in the name of the
evaluation functions is not appropriate.
Change-Id: I32960164ba73fb706eef5a5a617df7d47e24a074
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98357
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2019-04-02 12:11:58 +00:00
Jens Johansen
8ce2d7a4e1
[CFE] Better error messages on errors with user definable operators
...
Fixes #36383
Change-Id: I24fd51bdb3ead75973009fe515819f9c8354e1b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98332
Commit-Queue: Jens Johansen <jensj@google.com >
Reviewed-by: Kevin Millikin <kmillikin@google.com >
2019-04-02 10:46:18 +00:00
Aske Simon Christensen
87de68341f
[CFE] Disallow property access on instance constants.
...
Change-Id: I06b87332774790ae0c650810541bb6828101c3ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98335
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2019-04-01 15:51:34 +00:00
Johnni Winther
1a3e8dda3b
Handle nested unevaluated constants in constant evaluator
...
The constant evaluator assumed that any ConstantExpression met during evaluation of a sub expression was not an unevaluated constant. This do occur, for instance when a field is initialized to an unevaluated constant. With the change, unevaluated constants met during evaluation are themselves evaluated.
This change also fixed handling of assert initializers in unevaluated constants.
Change-Id: Id9e676f40bc829c4d234f34a74ef0ca5c4c6ec48
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98348
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
2019-04-01 14:29:32 +00:00
Aske Simon Christensen
277f65ec93
[CFE] Permit evaluating a const variable more than once.
...
This happens for instance in language_2/const_qq_test.
Change-Id: Ibad3f578f765cf2dccbf1e6c50ef0ff7187f5f8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98334
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2019-04-01 13:44:13 +00:00
Aske Simon Christensen
a88b653e03
[CFE] Bubble out InvalidExpression from unevaluated constants.
...
This allows backends that do not understand unevaluated constants,
such as the VM, to properly throw when encountering static errors
inside constant expressions.
Change-Id: Ida0f213cacbc66aea9bb1db2ddbd3fb4b8405eae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98352
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Aske Simon Christensen <askesc@google.com >
2019-04-01 13:11:47 +00:00
Johnni Winther
05dd851566
Test late CFE constant evaluation.
...
Tests that dart2js can handle evaluation of unevaluated constants from CFE, including handling of potential compile-time errors found during evaluation.
The CL fixes a bug in the constant evaluator where it created map literals that were not marked as constant as needed.
Change-Id: I7df77a3c68e52392a143478b3567d19e09ebe6bf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98347
Commit-Queue: Johnni Winther <johnniwinther@google.com >
Reviewed-by: Aske Simon Christensen <askesc@google.com >
Reviewed-by: Sigmund Cherem <sigmund@google.com >
2019-04-01 13:05:52 +00:00