Commit Graph

507 Commits

Author SHA1 Message Date
Jens Johansen 85699cfa6b [parser] Remove 'discardTypeReplacedWithCommentTypeAssign' from Listener
It was never called anyway.

Change-Id: I774dd6fcdaad29fe7b9ff00e70264389a7a4a31c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159662
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-27 11:26:17 +00:00
Johnni Winther 3485a2333c [cfe] Catch and report non file system errors when trying to read a file.
When a crash occurs in Uri it doesn't include the content of the failing
Uri, making it very hard to determine why the error situation occurred.
With the change the offending Uri will be printed as part of the message.

Change-Id: I41bb9762e5fc8deb97e051adaf336ecf3599a901
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160281
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-26 10:32:24 +00:00
Johnni Winther 4996d11854 [cfe] Handle experiment release version in CFE.
Closes #43033

Change-Id: I6752d19e56586e4072de1c0f4a7cc31ca3500691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160062
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-25 12:32:50 +00:00
Konstantin Shcheglov a51f1747e0 Prepare to publish analyzer 0.40.0 and _fe_analyzer_shared 8.0.0.
Change-Id: I126207dcc47885565a3a6d7002ff15ad3cc493c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-18 15:12:10 +00:00
Jens Johansen 8bca93872a [parser] Better error message for annotations on type arguments
This CL changes the message given in the situation identified in
https://github.com/dart-lang/sdk/issues/22314

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

Change-Id: Ibd47dd419d52673ae0d9e32039e0a635c1e09543
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158388
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-08-17 07:43:52 +00:00
Paul Berry e403e6ae77 Flow analysis: rework handling of equality tests.
The new logic classifies the LHS and RHS of the equality check as
either null, non-nullable, or potentially nullable, and then either
promotes, treats the expression as equivalent to a boolean, or does
nothing, as appropriate.

This means, for example, that a comparison between a non-nullable
value and `null` is now known to evaluate to `true` for reachability
analysis.

Note: as part of this change, it was tempting to trigger promotion
whenever a varialbe is equality compared to an expression of type
`Null`, but this would be unsound (consider `(int? x) => x == (x =
null) ? true : x.isEven`).  So we still only promote when the variable
is compared to a literal `null`.

Fixes #41985.

There's a corresponding spec change out for review:
https://github.com/dart-lang/language/pull/1134

Change-Id: Id7f1d4eaa3b0fa57124445bb8352eef32c304feb
Bug: https://github.com/dart-lang/sdk/issues/41985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155926
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-14 12:16:36 +00:00
Johnni Winther e597681d22 [cfe] Update messages for failures to opt in to non-nullable experiment
Change-Id: I16d71feeb51a7eee13048195898adfe7bf5761d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157482
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-08-14 09:01:07 +00:00
Paul Berry 06aff09656 External/abstract field support: prohibit a field from being both external and abstract.
Change-Id: I8c4dd136dc8c6518fddda68cfcb360cea8386942
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-13 16:11:34 +00:00
Jens Johansen 7e42cbf582 [parser] Change recovery of multiple extends with comma
E.g. class Foo extends Bar, Baz {} would before have parsed weirdly,
but it will parse as you'd (probably) expect with an error saying
you cannot do that. For now at least both CFE and Analyzer will
pretend like you just specified the first one but I suppose Analyzer
could for instance use the extra information to propose converting
other ones to implements clauses or similar.

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

Change-Id: I180cdd8ab07143dd74fd21c9976ec2a46c428d8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158261
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-08-13 08:49:53 +00:00
Paul Berry a3b15aefca External variable support: do not allow external variables to be late.
Although this error condition is not reported by the parser, the
language grammar does not it, so from a customer perspective it is a
parser error.  Accordingly, it has been assigned a ParserErrorCode and
is reported by the AstBuilder, as we do for other similar errors.

Change-Id: I22aad9b0acd27bf6e60dfb393837d48a49fc336b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158365
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-13 03:53:38 +00:00
Konstantin Shcheglov 0412862a9f Prepare to publish analyzer 0.39.17 and _fe_analyzer_shared 7.0.0.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: Ie87fc587ac7f9b83f2853e9cd0b4704bafd9fa71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158146
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-11 19:00:02 +00:00
Jens Johansen 4c0cab024e [parser] No longer support ?.[ syntax
Update CFE tests (and a few analyzer tests) to match the new world
of the syntax being unsupported.

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

Change-Id: I71bc973f36dfb978ddb825edb68530d8e260a58a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157980
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-11 08:09:59 +00:00
Paul Berry 87f0d5d9dc Abstract field support: do not allow abstract fields to be late or static.
Although these error conditions are not reported by the parser, the
language grammar does not permit them, so from a customer perspective
they are parser errors.  Accordingly, they have been assigned
ParserErrorCodes and reported by the AstBuilder, as we do for other
similar errors.

Change-Id: I79d0ad1dcad518981b8b649c117df326279008f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157800
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-10 19:27:13 +00:00
Srujan Gaddam e51623f81a [package:js] Add errors for missing @JS on class
Adds errors for class members that have a @JS annotation but the
enclosing class does not.

Change-Id: Id693af71678510047a723863846d89aa29cebe26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157004
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-07 17:09:23 +00:00
Konstantin Shcheglov fd4edad020 Update id tests constants/ to use getDisplayString().
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: If7d737ca3a31954e4d3c061d316548e8f54b0d10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-04 23:38:32 +00:00
Srujan Gaddam 7bb0d1f39a [package:js] Add error for params in factories of anon classes
Adds a static error to check that factory constructors in anonymous
classes contain no positional parameters.

Change-Id: Iae7c5c1d9e2dc91390c85c58eb5e96718e808f9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156145
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Srujan Gaddam <srujzs@google.com>
2020-08-03 23:20:42 +00:00
Johnni Winther ad9c73cb32 [cfe] Use promoted type as type context in variable assignment
Closes #41698

Change-Id: Iea87c770b560f6f72f9382f06615d99ad2be0c3a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155764
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-08-03 10:37:41 +00:00
Johnni Winther 135c44afd9 [analyzer,cfe,dart2js] Ensure id-testing shards are deterministic
Sharding was based on the directory listing. Now we sort the entities
by test name before sharding to avoid dependency on the file system.

Change-Id: I5e6ecc191d84eb1820c05bcef0a27d8b03d89286
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156025
Reviewed-by: Jens Johansen <jensj@google.com>
2020-07-29 09:45:59 +00:00
Johnni Winther a021b99fc3 [cfe] Fix scope setup for generic function types
Closes #36870
Closes #41951
Closes #42364

Change-Id: Id323bfdc26c688bfeb756ef8c1e0530283b44e34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156028
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-29 09:04:24 +00:00
Johnni Winther 767692b32f [cfe] Remove error/warning on duplicate library name in export/import
Closes #42700

Change-Id: I1fd047ea91de45be727690cf6053298cecf91410
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155326
Reviewed-by: Jens Johansen <jensj@google.com>
2020-07-29 08:53:06 +00:00
Johnni Winther fffd0d04b1 [cfe] Handle Null/Never-ish spread element types
Closes #42758

Change-Id: I0b25a5a1abc0896300f61fc98f514f1ed1a63e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155447
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-28 06:29:36 +00:00
Johnni Winther b8dc7627a9 [cfe] Handle NullCheck in constant evaluation
Closes #42802
Closes #42803

Change-Id: I282539cbfef90309dd343950101aefe0820785b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155600
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-07-23 09:16:09 +00:00
Johnni Winther fcd1c5b61a [cfe] Implement remaining external/abstract field errors
Closes #42718

Change-Id: Ifca0b1e8c1db93cad2283bc1a5d8a0534665e932
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155122
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-21 11:14:52 +00:00
Johnni Winther 9f50ee4e38 [cfe] Implement TypeOperations.isNever
Change-Id: I0e87392a47178a9c8473baf562e3034734f548f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155123
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-21 11:14:43 +00:00
Konstantin Shcheglov 01294566d4 Prepare to publish analyzer 0.39.14 and _fe_analyzer_shared 6.0.0.
R=brianwilkerson@google.com, pquitslund@google.com

Change-Id: I6f5e92ab29f757294a18dfff17c14745999bfa1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155065
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-21 00:51:14 +00:00
Srujan Gaddam 7c40665f91 [package:js] Add static errors for named parameters and tests
Adds error for named params in JS interop functions, static error
tests, and removes redundant code from dart2js.

Change-Id: Ie16ebdd7a816983c1250579ea346e31e77227112
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154752
Commit-Queue: Srujan Gaddam <srujzs@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-07-20 20:27:07 +00:00
Paul Berry ded9b3ce3f Flow analysis: consider promotion to Never to be unreachable.
Fixes #41981.

Bug: https://github.com/dart-lang/sdk/issues/41981
Change-Id: Id2ce176c703cb3346d4bd7471b10ecac9e3b9907
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154624
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-20 16:17:57 +00:00
Johnni Winther 87906e832b [cfe] Implemenet abstract fields errors
Change-Id: I78900228ee72d914844e9fe11fcfb2cdef952ece
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154881
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-20 12:05:54 +00:00
Johnni Winther 92f4eb58c8 [cfe] Support abstract fields
Only positive implementation, no error states are checked yet.

Change-Id: Iad79da1dd7e8be9229ee9d47c5301d39ebc3debc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154003
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-16 10:13:23 +00:00
Paul Berry 8cb7dfa70f Modify parser to handle abstract fields.
There is no functional change to the analyzer or CFE yet; we simply
report the error in the parser listeners now rather than the parser
itself.  In follow up CLs when we add full support for the feature, we
will want to keep the error reporting logic, but only report the
errors in pre-NNBD code.

Change-Id: Ifd14dd97d7d1d57586a8e14a25103356d54f0ea1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154364
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-07-15 22:48:01 +00:00
Paul Berry 4a4bb55150 Make "ID" tests insensitive to what directory they're run from.
Previously, they needed to be run from the root of the SDK repo, which
made testing under IntelliJ a pain, since by default IntelliJ runs
executables from the root of the local package.

Change-Id: I89d9bbbca38307016fcea4717010c19b9720b463
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154285
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-14 15:33:59 +00:00
Konstantin Shcheglov 8608726100 Stop supporting 'target?.[index]' and QUESTION_PERIOD_OPEN_SQUARE_BRACKET.
Change-Id: Icac4f851fbb9f283ce28ba8753c1b2e27a99cff3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154165
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-14 14:36:19 +00:00
Johnni Winther 7269b792c1 [cfe] Update message for opt-out packages run with sound null safety
This groups the message for opt-out packages and mentions running
'pub outdated' to looked opted in versions.

Closes #42464

Change-Id: Ib3bc411c5f3523af3672bed8837e953aaa551479
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153964
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-13 13:37:55 +00:00
Jens Johansen 01ac35b844 [parser] Allow '..' as something following a nullable type
Fixes https://github.com/dart-lang/sdk/issues/42621

Change-Id: I56fd9475ffb3821592a6917949e858c6e48bdf20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153773
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-07-09 15:03:17 +00:00
Johnni Winther 9ab7a5edef [cfe] Use variable name in error message for missing initializer
Closes #42610

Change-Id: I70a5ac9302bd6545cd5e73f2dab61a29bc6a3000
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153462
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-08 12:45:15 +00:00
Paul Berry 36e89f845b Flow analysis: ensure that restrict method doesn't try to promote write-captured variables.
Fixes #42066

Change-Id: Ieab80c004b3d331abb81916c3e158416bcd3ce86
Bug: https://github.com/dart-lang/sdk/issues/42066
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153480
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-08 01:37:30 +00:00
Johnni Winther 34f5c9d0b4 [cfe] Implement new async return rules
Closes #41800
Closes #41900
Closes #42134
Closes #42282
Closes #42236
Closes #42169

Change-Id: Ia994bc07fba4e2342fcb59d44fc77608198a328b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152150
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-07-06 07:04:40 +00:00
Paul Berry 63feed82e1 Rename FlowModel.removePromotedAll to .conservativeJoin.
This makes the implementation consistent with the spec text in
https://github.com/dart-lang/language/commit/1ed6bab4cc5a826f1ed6a81fb70a4f23815e1a82.

Change-Id: Ie25b928c5aacb45a18e85c6f9196b5b55f083478
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152983
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-07-01 13:46:48 +00:00
Johnni Winther 236f3f820d [cfe] Fix flow analysis in initializers
The handling of null shorting in the variable initializer interfered with
the declaration of the variable, making subsequent flow potentially
losing track of promotions.

Closes #42504

Change-Id: Idb17920ffe8746983825714f76160abcca54751b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152760
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2020-07-01 08:57:18 +00:00
Konstantin Shcheglov 7ee4dd1be5 Prepare to publish analyzer 0.39.11 and _fe_analyzer_shared 5.0.0.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: Ia7cb0355c2595ba6f84f19f6f62b468ccd6d7d72
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152986
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-30 23:14:37 +00:00
Paul Berry 019755f77b Flow analysis: simplify marking of loop-assigned variables as not-unassigned
At the top of a loop, loop-assigned variables need to be marked as not
definitely unassigned, otherwise we will give incorrect results for
code like this:

```dart
f() {
  late int x;
  bool firstIteration = true;
  while (true) {
    if(firstIteration) {
      x = 0;
      firstIteration = false;
    } else {
      print(x); // BOGUS ERROR: x definitely unassigned
    }
  }
}
```

Previously, we were handling this by calling `joinUnassigned` at the
bottom of `removePromotedAll`, but it's simpler to just mark these
variables as not-unassigned while discarding promotions.  This change
will make the implementation more closely match spec changes I'll be
making shortly.

Change-Id: If50e28d20a75730aa5187a62ae5cac8690b0dfaf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-06-30 02:46:26 +00:00
Johnni Winther d5120208b4 [cfe] Update CFE message to use 'null safety' instead of 'non-nullable'
Closes #42464

Change-Id: I2865cd4ff2fac3c40d5f8b8d26d6b958919682b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152481
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-26 13:09:52 +00:00
Sam Rawlins d022d4c9e1 Migrator: Fix if-null promotion with GLB
Fixes https://github.com/dart-lang/sdk/issues/42375

EdgeBuilder wishes to do its own GLB type-joining, as does FlowAnalysis.
When FlowAnalysis pushes a promotion in ifNullExpression_rightBegin,
and then in write, and then pops those two promotions to join them in
ifNullExpression_end, EdgeBuilder is not given a chance to make its
own GLB node. Instead promotion never happens: the DecoratedType which
is the variable's type is promoted to non-nullable, for the left side.
The DecoratedType for the right side expression is not considered
non-nullable, so the FlowAnalysis.join will always fail to promote.

TypeOperations.adjustPromotedTypes solves this. It is a no-op in all
implementations except in EdgeBuilder.

Additionally FlowAnalysis.write's promotion fails for the same reason:
the only type of interest is the declared type made non-nullable, and
no matter what, the writtenType is not a subtype of this.

TypeOperations.forcePromotion solves this. It is a no-op in all
implementations except EdgeBuilder.

Change-Id: Iba6b9a69583af8fe1aa23124c7d66047acfff495
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152104
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-25 21:09:12 +00:00
Mayank Patke 3b67681bcc [dart2js] Clean up (pre-)NNBD unit test configurations.
Change-Id: Ife85aafa90b1b0347fabb6e95f3d6c00c5307cd2
Bug: https://github.com/dart-lang/sdk/issues/42063
Fixes: https://github.com/dart-lang/sdk/issues/42063
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152440
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2020-06-25 18:44:32 +00:00
pq 43eb8790f3 Support for customized diagnostics
Rationale: internally we patch a number of diagnostic messages to add context to messages (and corrections). Introducing maps that allow for customization makes the internal patching process far easier and less prone to error.






Change-Id: I2d1e7488b451654dd24b8ae95647619c65d3974b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151664
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: David Morgan <davidmorgan@google.com>
2020-06-24 13:34:19 +00:00
Johnni Winther 7fce125300 [cfe,kernel] Add AstPrinter
This CL adds a Node.toText method together with an AstPrinter. These
facility and better toString implementation on AST nodes while allowing
for toString independent printing of AST to use in testing. This also
add support for an integrated toString of custom/internal nodes.

Some work is still needed in bringing the toString implementation on
all nodes to the old quality, and not all internal nodes have
customized textual representations yet. This work is left for future
CLs.

Change-Id: Ib0bf8a0bc02f489dfacdc8aa5f96da9c52f26058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150923
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-06-16 17:15:10 +00:00
Konstantin Shcheglov a1fc2ea80c Make variables assigned in a loop not definitely unassigned anywhere in the loop.
Bug: https://github.com/dart-lang/sdk/issues/42301
Change-Id: I75962b976427cef7f40025f1dcd9f27400306825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151047
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 17:29:05 +00:00
Konstantin Shcheglov 24852421e2 Change method override inference to use combined member signature.
https://github.com/dart-lang/language/pull/975

Change-Id: I5cec14a384b124a29dcd5adac0f0be6e5214cc9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151044
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 18:59:28 +00:00
Jens Johansen 50836c171e [parser] Fix parsing of empty index in cascade
Fixes #42267

Change-Id: Ia09fd9e564bc0b04cdd99d3aac5093a12ab10d96
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150926
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-06-12 06:36:58 +00:00
Konstantin Shcheglov 97e291ba9f Mark any variables assigned in the body of try/catch not definitely unassigned in catch.
Bug: https://github.com/dart-lang/sdk/issues/42235
Change-Id: Iad3792bef1dc8f468d8b9e7ec729e1cbdf6c946a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150600
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-10 16:17:37 +00:00