Commit Graph

392 Commits

Author SHA1 Message Date
Johnni Winther 25060e63c6 [cfe] Add tool for updating all id-tests and expectation tests
Change-Id: I191ebe0d59d44055a6818505db0112d3a452bdbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141242
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-03-27 14:52:20 +00:00
Jens Johansen 4ab3bda5db [parser] Change recovery for constructor; report errors in bad constructors
Change-Id: I3d656afce4a3ec14c7c099893a434abba3945ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/140862
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2020-03-27 11:57:56 +00:00
Brian Wilkerson 60a81b0f51 Add hints to find equal elements in literal sets and maps
Change-Id: Ib930b49b338d7cb088b17909991934b16c4f1538
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138602
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-03-06 14:22:44 +00:00
Paul Berry 794f70a044 Add currentVersion to experiments.g.dart code generated output.
Change-Id: I0ea91aaeb34068d25c07b61b0a432d24af0dd59a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138104
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-03-03 19:25:44 +00:00
Paul Berry d0826bdbd5 Add current-version field to tools/experimental_features.yaml.
Previously, each top level key/value pair in the file represented a
feature, so in order to make room for the new field, these were all
moved under a "features:" header.

Code generators have been updated to produce the same result as they
did before; in future CLs I'll update them to generate code based on
the new field.

Change-Id: Ia2266dd0d92796f15460127742eb2b56f64438e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138101
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-03-03 19:25:44 +00:00
Konstantin Shcheglov 9e4000e44b Issue 40603. Update MockSdk to stop returning null from factories.
Bug: https://github.com/dart-lang/sdk/issues/40603
Change-Id: Id1060773d303527424bde02785a5c21651df4c85
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137422
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-02-27 00:47:06 +00:00
Brian Wilkerson 4ef4371891 Replace "generates" with "produces" in the diagnostic docs for consistency
Change-Id: I231467cb2186d81068e99215a6e94d6f76a31666
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136641
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2020-02-20 17:22:19 +00:00
Brian Wilkerson d0e779ff71 Improve some diagnostic documentation
This recpatures some documentation lost in
https://dart-review.googlesource.com/c/sdk/+/129833.

Change-Id: Ie8355533bd0c42360c9d7dd2138813c83391d7c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/134981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-02-09 20:57:33 +00:00
Sam Rawlins 637a801e64 Use 'enum' and 'mixin' with undefined getters, methods, operators, setters
Fixes #40177

Change-Id: I0b416a4e77d3d1c5afc1712301c5cf1ea4cfc8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133043
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-01-30 17:01:58 +00:00
Brian Wilkerson 7d7643c2ad Add newly reviewed docs and change section header everywhere
Change-Id: I337fe5764b9167240b42cf75f908a3d36ef08cc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133407
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-01-26 22:56:45 +00:00
Konstantin Shcheglov b663ef5cc4 Build non-nullable or legacy SDK summary.
Bug: https://github.com/dart-lang/sdk/issues/38666
Change-Id: I24f6f36b5ed1dbef64588dd787aaf2abbd62f53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132800
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-22 18:02:08 +00:00
Johnni Winther 862d5012ae [cfe] Handle explicit opt-out in nnbd-not-enabled message
Closes #39835

Change-Id: I4ffa3377289f45b7ea909b5477ba53508040b9d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/131076
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
2020-01-15 10:30:43 +00:00
Konstantin Shcheglov 7b7d8789ca Use WRONG_NUMBER_OF_TYPE_ARGUMENTS instead of two other equivalent error codes.
R=brianwilkerson@google.com

Change-Id: Ibb5ea7d65df75655eaf2d43fba1110740be39912
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129833
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-31 20:27:03 +00:00
Konstantin Shcheglov 8a0d30d4e2 Fix annotate-overrides in analyzer.
R=brianwilkerson@google.com

Change-Id: I7a587daf9715ded6450b28ecf3892ce4181aeb37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129421
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-23 00:02:37 +00:00
Sam Rawlins 5dfa750393 Convert all function parameters and typedefs to generic syntax
Change-Id: I18f8644ecbe61555b2929ed09d446733d33ec2a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128521
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-12-16 23:36:38 +00:00
Paul Berry b048ac05e6 Fix code generators to avoid generating unnecessary consts
This change fixes pkg/analyzer/tool/summary/generate.dart and
pkg/analyzer/tool/experiments/generate.dart so that the code they
generate corresponds with the changes made in
54b7543c55.

This should fix the broken analyzer-linux-release bot.

Change-Id: I651197da0853687f15bff2f2365f0b85280b5d60
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128561
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-12-16 17:21:22 +00:00
Sam Rawlins 40718899fe Fix pedantic 0.9 lints around collection literals and spreads
Change-Id: I64277c36fbeb4ea7a1bb429a8e0a40203520c883
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128380
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-14 00:15:41 +00:00
Brian Wilkerson 43066c9911 Add newly reviewed diagnostic docs
Change-Id: I1a090ebd0129040a5fcbf2fca3919c6e22cf1daa
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128302
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-12-13 17:55:29 +00:00
Konstantin Shcheglov 54b7543c55 Fix unnecessary_const in analyzer.
The only non-mechanical change is update for tool/diagnostics/generate.dart
to handle MethodInvocation, because without resolution and without
explicit `new` and `const` we get MethodInvocation(s).

R=brianwilkerson@google.com

Change-Id: Ib89ce9c37066e9b27ad03aed96b349ef36f11d43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127453
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 15:03:00 +00:00
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00
Konstantin Shcheglov eee20b4e60 Fix prefer_equal_for_default_values in analyzer.
Change-Id: Ia72a2ac31d6cf6329c78baad6954ac9595a6c45a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127448
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 00:00:30 +00:00
Konstantin Shcheglov f772b572c8 Fix curly_braces_in_flow_control_structures lint.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I63cb372bf04f80182f873e2143971cb3cf1392fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127447
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-05 23:46:13 +00:00
Brian Wilkerson 46c042a118 Improve a diagnostic message by unwrapping Future (issue 39561)
Change-Id: Ie74200e8f41aa70c33f5d7a62c8d0a0ae7a96146
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126700
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-11-29 16:08:46 +00:00
Brian Wilkerson 3663abd8db Update the header in the generated diagnostic docs
Change-Id: I2dbf01bbde39029d06aa19fd5c6cd9d80cd3e06b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126241
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2019-11-26 00:37:53 +00:00
Konstantin Shcheglov dcaf959589 Fix several unused elements, and unnecessary casts.
R=brianwilkerson@google.com, paulberry@google.com

Change-Id: I81559cb241c0ca6918f6730538f44a7411907867
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125986
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 21:37:52 +00:00
Brian Wilkerson ad021d02d4 Integrate the latest batch of reviewed diagnostic docs
This includes a small improvement to the validation tests, but there is
also one code whose docs can't be verified without additional work that
I will do in a follow-on CL.

It also includes splitting one code into two to improve the messages.

Change-Id: I52989ca336e42822327e3ac3805b1654d20a479c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125901
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-21 15:21:55 +00:00
Brian Wilkerson 1f933abcee Convert a compile time error into a parse error (issue 39389)
Change-Id: I115c7bb4ab05f8c6e9ddc566985126a1b9a09842
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125621
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-11-19 18:25:29 +00:00
Brian Wilkerson c96fe4e006 Add more explaination to existing examples
Change-Id: I2f89ef54eb4467d23f7507c1217385a1df2d4a11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124594
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2019-11-16 02:52:18 +00:00
Johnni Winther a996783de5 [cfe+analyzer] Move StackListener to _fe_analyzer_shared
Change-Id: I7e0ebef15b904afc14ed3b1c0f72cde5389d9c59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123730
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-02 11:21:49 +00:00
Johnni Winther 00c2962db8 [cfe+analyzer] Move messages, scanner and parser to package:_fe_analyzer_shared
Change-Id: I4fa87aee65f30a9868a6cf8f0342591869ece7ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123663
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2019-11-01 09:37:57 +00:00
Brian Wilkerson df8876582c Include all variations of a message in diagnostic docs
We now have multiple messages for the same name (id) and all of the
messages should be included in the docs so that users aren't confused
when the message they see doesn't match what's documented.

Change-Id: I0f668ececae1e9852eff9db25f29a48b7414c4d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/123141
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-10-28 15:55:31 +00:00
Sam Rawlins 9cc57416be Change error node for MISSING_RETURN to be the name
Fixes #35607

Change-Id: I66b9921b0ede5370364b89a89fb19bf0df96ac97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122726
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-10-24 19:42:07 +00:00
Konstantin Shcheglov 8b1e73d15d Remove lazy FunctionTypeImpl.
Change-Id: I9dad79468560f1b4c4be793ba51105acf19f05d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122721
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-24 17:27:32 +00:00
Sam Rawlins 3778839976 Fix version number that first supports ui-as-code; fixes #37898
Change-Id: Iaaec4dedbe8f9b2b5331fa9c69c39d5032383d75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113743
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-15 19:35:49 +00:00
Jens Johansen 8f477fd84a [parser] Disallow covariant on extension method parameters
Fixes #38560.

Change-Id: I4c941fb6713983cc01efbe143c7924d0643efe73
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119332
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2019-10-08 13:01:40 +00:00
Konstantin Shcheglov ad47b1ca64 Remove summary1, part 2.
Change-Id: I050b62bbbd77db6bd6a2d815e70cfe92cc9432a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119220
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-10-07 17:35:55 +00:00
Brian Wilkerson 04910d62f5 Include the deprecation message in diagnostics (issue 38667)
Change-Id: Ib1fa24fa4b112b9675d1f1900cbdda15319080a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119780
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-10-04 16:27:07 +00:00
Konstantin Shcheglov 3f65652ad0 Enable avoid_init_to_null.
R=brianwilkerson@google.com

Change-Id: I983fdff71c47dbf2b271508955095a73cfbeee59
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119380
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-30 14:26:06 +00:00
Konstantin Shcheglov 595022bdea Remove summary1, part 1.
Change-Id: I557785ac13fa411280ce032324b0305bf25a0a6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119170
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-28 14:30:05 +00:00
Brian Wilkerson 61b4c0f770 Cleanup hints and lints in analyzer packages
Change-Id: I7f1a6ad1ed3610da9616683576ebfb5efd543fd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119164
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-27 16:12:44 +00:00
Brian Wilkerson 3c18db7d9e update analyzer error message generator to generate hasPublishedDocs
Change-Id: I87fae43033876c84448e785417bd5a72efe52ef9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118180
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-09-26 17:11:02 +00:00
Brian Wilkerson a2803a1b2d Add documentation for more diagnostics
Change-Id: I8270a74cc5a70dd16a46e3a7b2ff2bb822b69fb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/118820
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-25 16:38:06 +00:00
Brian Wilkerson 139889e2b9 Fix a couple of diagnostic messages and re-order several constants to restore alphabetic ordering
Change-Id: Ifb853a1ae6b9b22e2f8e65c304b43ba2b8b895d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117161
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-13 15:58:42 +00:00
Brian Wilkerson c74e68e501 Add documentation for more diagnostics
Change-Id: Id2aeb13db0ceb81fc18d67e6ef2778304b36d02b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/117000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-12 16:35:46 +00:00
Konstantin Shcheglov e8836f5086 Fix sample for UNDEFINED_SETTER.
R=brianwilkerson@google.com

Change-Id: I9c897ee5890d4b951cf157a5da6c21a5505248d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-09-11 21:20:57 +00:00
Brian Wilkerson d36f5ed181 Fix diagnostic documentation tests and add support for documenting parser codes
Change-Id: Ie2e360e6e4a344888bb409d20f21c969280bbdf9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/116742
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2019-09-11 19:45:47 +00:00
Brian Wilkerson a94a3c60d7 Format the code snippets in docs
Change-Id: Ieabed8b05df79b4872090e82cdc6ceb941979e71
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115060
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2019-08-30 16:38:14 +00:00
danrubel 6061906a77 split endMethod into 6 separate events
This updates the parser to detect constructors vs methods
in classes vs mixins vs extensions. Rather than generating a single
endMethod event and require listeners to determine the type of
declaration, the parser now generates different events for
different types of declarations so that listeners can process
each of these different types separately.

In addition, this lays the groundwork for fixing extension declaration
error messages and moving error generation that is duplicated
in the various listeners into the parser.

Change-Id: Ia86a4bf3e6f1442ca4926c754b66e7d6e86fb47d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114900
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-30 00:33:43 +00:00
Brian Wilkerson 7eecb77b0f Minor updates to the diagnostic docs
Attempt to fix the link to the glossary and consistently place 'keyword'
after the name of the keyword in text.

Change-Id: Ib5f75568bdea0a875d1829ab52cbe93894e7f595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114742
Commit-Queue: Kathy Walrath <kathyw@google.com>
Reviewed-by: Kathy Walrath <kathyw@google.com>
2019-08-28 17:29:01 +00:00
danrubel 7b37cddbe8 rename ClassKind to DeclarationKind
... and add DeclarationKind.TopLevel

Change-Id: I631c0173a056e856845f02d4415c11336a796e3c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114629
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-28 00:57:42 +00:00