Commit Graph

92 Commits

Author SHA1 Message Date
Sam Rawlins cc9c8f93f5 Add HintCode for duplicate shown/hidden names
Bug: https://github.com/dart-lang/sdk/issues/33182
Change-Id: Ibb82c44357bc59044340c6d8b1904c7815d19215
Reviewed-on: https://dart-review.googlesource.com/57161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2018-05-30 17:22:40 +00:00
Brian Wilkerson 74db253d34 Allow metadata on enum constants
Change-Id: I2aed6df1fd5f20da865339fdc86cad3bc66f0770
Reviewed-on: https://dart-review.googlesource.com/54621
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-05-14 13:20:10 +00:00
Brian Wilkerson 9e9b50d19d Improve error messages for annotations involving undefined names (issue 27788)
Change-Id: Iccfcb73b7671f50353b57a81817dec013b997a53
Reviewed-on: https://dart-review.googlesource.com/52640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-25 17:48:49 +00:00
Brian Wilkerson bf1d0efde2 Revert "Improve error messages for annotations involving undefined names (issue 27788)"
Change-Id: I017592bf8982ff51bb73eb5fe892f8d9cffb9c9d
Reviewed-on: https://dart-review.googlesource.com/52400
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-04-23 21:05:53 +00:00
Brian Wilkerson 1ffd7e529a Improve error messages for annotations involving undefined names (issue 27788)
Change-Id: Ib7af4bdd97e9f775646c90e8f49f021836125b78
Reviewed-on: https://dart-review.googlesource.com/52240
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-04-22 20:11:11 +00:00
Leaf Petersen c2b338f1b7 Remove fuzzy arrow support from analyzer
Fixes #31637

Change-Id: I87767b92814455187ea71cc4caca786043dbbe3d
Reviewed-on: https://dart-review.googlesource.com/51100
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-04-13 16:47:16 +00:00
Dan Rubel 374058aa79 Improve fasta parser try/catch error messages and recovery
Change-Id: I6e591fa5d03c73aa6f3e8060f2ca310f68be9a78
Reviewed-on: https://dart-review.googlesource.com/48709
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-04-01 02:14:52 +00:00
Konstantin Shcheglov f201ace7f3 Check for missing required libraries dart:core and dart:async.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/32686
Change-Id: I337cb61911061f25b501a5615fe40c02b9749b19
Reviewed-on: https://dart-review.googlesource.com/48703
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-03-29 22:09:50 +00:00
Paul Berry 2993476129 Report an error if a class inconsistently implements a generic interface.
This is not allowed in Dart 2.0.

Change-Id: I6861ce298e5d5a5cf3f26a010990868b5ba9bda2
Reviewed-on: https://dart-review.googlesource.com/39601
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-03-05 12:13:12 +00:00
Paul Berry 593273cf51 Finish implementing mixin type inference in the analyzer.
Fixes #32146.

Change-Id: Ia46b6a54757901681858e682bdd6f809c194999c
Reviewed-on: https://dart-review.googlesource.com/43944
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-27 17:49:59 +00:00
Dan Rubel a8be36f42a Report error on dynamic with type arguments
Change-Id: Ie95e1c1b0b23cb3a3b6d4b7b7561edc2765fdebb
Reviewed-on: https://dart-review.googlesource.com/43560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
2018-02-23 21:49:07 +00:00
Alexandre Ardhuin 3caa0f9fee more null-aware hints
This adds 2 new hints `NULL_AWARE_BEFORE_OPERATOR` and `NULL_AWARE_IN_LOGICAL_OPERATOR`.

The previous `NULL_AWARE_IN_CONDITION` hint didn't catch null-aware issues in assigments or expression statements with logical operators. `NULL_AWARE_IN_LOGICAL_OPERATOR` handles those cases.

`NULL_AWARE_BEFORE_OPERATOR` handle issue like `a?.b + c`.

Closes #32239
https://github.com/dart-lang/sdk/pull/32239

GitOrigin-RevId: 8b20ec5f7ea7901b1d0889eaf54ad0660c6e3f76
Change-Id: I36ada68c13dd0e1dd2bfd829ae25ce3ba9c8f402
Reviewed-on: https://dart-review.googlesource.com/42360
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-02-20 21:48:35 +00:00
Mike Fairhurst 56d59dd967 Reland https://dart-review.googlesource.com/c/sdk/+/37441 with fixes
Change-Id: If8e2ec2ca1ac4f533dcb56b0c95d55e4a13e0598
Reviewed-on: https://dart-review.googlesource.com/39881
Reviewed-by: Paul Berry <paulberry@google.com>
2018-02-08 20:46:19 +00:00
Mike Fairhurst ec58f5646a Revert "Make void a static warning to use almost everywhere."
This reverts commit 09eed74a8a.

Reason for revert: Too much SDK code is not yet compliant.

Original change's description:
> Make `void` a static warning to use almost everywhere.
> 
> Changed the hint to a StaticWarningCode, since that's the new spec'd
> error type and the hint is no longer needed.
> 
> Added a new set of methods to test the cases.
> 
> Didn't try to solve the problem generally ("all usages except ... are
> errors" means it easier, in theory, to make a ReportVoidExpressions
> style visitor that catches absolutely all types) because most of the
> work is actually about suppressing errors that are no longer needed.
> Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
> put the void handling logic into each AST method specially anyway.
> 
> Some redundant tests removed.
> 
> Don't flag: ternaries, void -> void assignments, void returns in
> dynamic.
> 
> Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
> Reviewed-on: https://dart-review.googlesource.com/37441
> Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
> Reviewed-by: Leaf Petersen <leafp@google.com>

TBR=leafp@google.com,scheglov@google.com,mfairhurst@google.com

Change-Id: I13ee4c6939468d35506779ade637a040833632f4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/39848
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2018-02-07 22:32:51 +00:00
Mike Fairhurst 09eed74a8a Make void a static warning to use almost everywhere.
Changed the hint to a StaticWarningCode, since that's the new spec'd
error type and the hint is no longer needed.

Added a new set of methods to test the cases.

Didn't try to solve the problem generally ("all usages except ... are
errors" means it easier, in theory, to make a ReportVoidExpressions
style visitor that catches absolutely all types) because most of the
work is actually about suppressing errors that are no longer needed.
Ie, from NO_SUCH_METHOD to USAGE_OF_VOID_RESULT which means we have to
put the void handling logic into each AST method specially anyway.

Some redundant tests removed.

Don't flag: ternaries, void -> void assignments, void returns in
dynamic.

Change-Id: Ief8035dcfe582b36b6372180ddcf4e453d320d9c
Reviewed-on: https://dart-review.googlesource.com/37441
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Leaf Petersen <leafp@google.com>
2018-02-07 21:36:01 +00:00
Paul Berry f299f2d00f Remove error code TOP_LEVEL_TYPE_ARGUMENTS, which is no longer used
Change-Id: Ic41373617a5c96906840ac49bc13825323b486c6
Reviewed-on: https://dart-review.googlesource.com/39560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2018-02-07 14:41:42 +00:00
Paul Berry d9d2dc405b Infer mixin types in the analyzer.
This follows Leaf's simplified suggestion.  As a temporary hack it
assumes that the mixin passes its type parameters through to its
superclass constraint unchanged.

Change-Id: I091b44005d6364a91e20578f2ff6340334b1fab6
Reviewed-on: https://dart-review.googlesource.com/38040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-02-07 10:45:39 +00:00
Brian Wilkerson b74ceb0248 Remove a warning (issue 31351)
Change-Id: Id798aa7ece345970e3bfba15b260df6482a57074
Reviewed-on: https://dart-review.googlesource.com/37861
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-31 20:42:26 +00:00
Brian Wilkerson 1d9ac49dd9 Reland "Add an error when an integer literal is out of bounds"
Change-Id: Id6ef76b47bedabc96fc372f6aea455975dfcc213
Reviewed-on: https://dart-review.googlesource.com/37840
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-01-31 16:50:55 +00:00
Paul Berry d68fbb7454 Add new warning StrongModeCode.TOP_LEVEL_INSTANCE_METHOD.
This warning fires if a top level initializer depends on the type of a
method whose type is subject to type inference.  This warning is
needed because the analyzer implementation of top level type inference
doesn't guarantee that the method type will be inferred prior to the
initializer, so it's possible that type inference will produce an
incorrect result.  See #31925 for more details.

Change-Id: Iec048d2638877c16ae11a87eae0382b7352f726c
Reviewed-on: https://dart-review.googlesource.com/36841
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-26 01:10:00 +00:00
Brian Wilkerson 86b27dd577 Add a hint for unused labels (issue 31930)
Change-Id: I0d2f41fdb8a7399e6664dcf57503de84991c075d
Reviewed-on: https://dart-review.googlesource.com/36181
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-22 18:34:28 +00:00
Brian Wilkerson e95486d18e Revert "Add an error when an integer literal is out of bounds"
Change-Id: I2376904a8b92382c0f33212f41c88bafd75f3a15
Reviewed-on: https://dart-review.googlesource.com/35806
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2018-01-18 22:40:14 +00:00
Brian Wilkerson cf7efddb0b Add an error when an integer literal is out of bounds
Change-Id: I8bc9e6e03d76822785f254ec346d82983ea63f2c
Reviewed-on: https://dart-review.googlesource.com/31841
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2018-01-18 17:30:54 +00:00
Leaf Petersen fff71ee60f Make USES_DYNAMIC_AS_BOTTOM (fuzzy arrows) a warning
Fixes https://github.com/dart-lang/sdk/issues/31874 .

Change-Id: I75b43f52692f5860d8c4e78acb15b9c9281754a5
Reviewed-on: https://dart-review.googlesource.com/34506
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2018-01-17 17:15:18 +00:00
Konstantin Shcheglov 4e9e5d0569 Assign analyzer codes to several FrontEnd errors.
R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: I2cf2a948048245e016f0f3d316dcf889c4bde31d
Reviewed-on: https://dart-review.googlesource.com/33583
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2018-01-09 21:25:48 +00:00
Sam Rawlins b50319ca9f Fix RETURN_OF_INVALID_TYPE for anonymous closures
The displayName of an anonymous closure is a blank String, resulting in messages like:

    [error] The return type 'String' is not a 'int', as defined by the method ''.

After this change, an error might instead look like:

$ xcodebuild/ReleaseX64/dart-sdk/bin/dartanalyzer --strong 26056.dart
Analyzing 26056.dart...
  error • The return type 'String' isn't a 'int', as defined by anonymouse closure at 26056.dart:6:28 • return_of_invalid_type
  1 error found.

Bug: https://github.com/dart-lang/sdk/issues/26056
Change-Id: I4003eea22cb23e0b06479482c06d5ce8a936c756
Reviewed-on: https://dart-review.googlesource.com/28382
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-18 15:33:06 +00:00
Leaf Petersen 53908b0790 Remove warning for "is" checks with generic type parameters.
The analyzer used to emit a warning when a type parameter to a generic
method was used in an "is" check.  This warning was there to help
users write code that worked correctly on both Dart 1.0 and 2.0.  Now
that 2.0 generic methods are being more broadly supported and used,
this warning is blocking further library work, and is being removed.

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

Bug:
Change-Id: I70395305ad082aee3072b5beeb0b1b7f7883391b
Reviewed-on: https://dart-review.googlesource.com/29821
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-15 18:12:03 +00:00
Sam Rawlins ee07335392 Improve message around re-assigning a local final.
Add a new ASSIGNMENT_TO_LOCAL_FINAL code for the new text.

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

Bug: https://github.com/dart-lang/sdk/issues/28721
Change-Id: I5492dd0d9ee09d5b73296b46fe10271661c3c64f
Reviewed-on: https://dart-review.googlesource.com/29621
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2017-12-15 01:09:55 +00:00
Paul Berry 09e432a914 Remove StrongModeCode.UNSAFE_BLOCK_CLOSURE_INFERENCE, which is no longer used.
Change-Id: I289a194670dbdec7cda3522bea614beae09a18c3
Reviewed-on: https://dart-review.googlesource.com/29543
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-12-14 15:08:46 +00:00
Sam Rawlins 14629098dd Enforce @visibleForTesting annotations.
In particular, enforce that a method annotated with @visibleForTesting can only
be referenced from within the declaring library, or within a file that has
"/test" in its path. This allows @visibleForTesting methods to be accessed from
test files, or files in "/testing" folders, etc.

Bug: https://github.com/dart-lang/sdk/issues/28273
Change-Id: I3c19f73be330c49face7e3203879742d514bca74
Reviewed-on: https://dart-review.googlesource.com/27201
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-12-14 00:17:24 +00:00
Dan Rubel a02662c47e improve errors and recovery for factory methods
Change-Id: I55711bdb0f98c0747c7055bebda173702c2c138f
Reviewed-on: https://dart-review.googlesource.com/16720
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
2017-10-26 21:21:00 +00:00
Dan Rubel 1c7c72c679 Refactor and update modifier warnings
* Extract parse modifiers
    into ModifierContext and ModifierRecoveryContext
* Recover gracefully given out-of-order modifiers
* Generate analyzer error codes
* Address comment in prior CL
    https://dart-review.googlesource.com/c/sdk/+/10760/1/pkg/front_end/lib/src/fasta/parser/parser.dart#436

There are several more modifier error codes that need to be added.
I will tackle those in a subsequent CL.

Change-Id: I61e9182e14fa9d45b35029013a645329e6cc54ab
Reviewed-on: https://dart-review.googlesource.com/11800
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-10-11 23:32:10 +00:00
Devon Carew 5883eb9904 Add a hint for strong-mode: false in the analysis options file.
Related to https://github.com/dart-lang/sdk/issues/30789

Bug:
Change-Id: I77c85e49001934ce49708cddc431a6c1a082d386
Reviewed-on: https://dart-review.googlesource.com/9789
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2017-09-29 23:03:16 +00:00
Dan Rubel 9527f37146 refactor parse import
* `as` clause and `deferred as` clause processing pushed
     into a new processImportPrefixOpt method.
* New handleImportPrefix event for communicating 
    `as` clause and `deferred as` clause to the listeners.
* Several new more detailed error messages for out of order
    clauses and keywords in the import directive.

Change-Id: I133842c7225403fa000ca1cf0e49af9f8a011386
Reviewed-on: https://dart-review.googlesource.com/8580
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-29 14:39:01 +00:00
Dan Rubel f0caee1b24 Improve import directive recovery and report analyzer errors
- New handleRecoverImport event
    for clauses in import directive that are out of order
- New error codes for
    Duplicate prefix
    Prefix after combinator

Change-Id: I0fea7ad4b4014a0b8578d3982e0515fe85044854
Reviewed-on: https://dart-review.googlesource.com/7980
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-27 12:56:46 +00:00
Konstantin Shcheglov 73c93a3a13 Revert "Report compile time errors when assert initializers fail."
This reverts commit 556b0284b3.

Until the specification wording about constants evaluation is clarified.

R=brianwilkerson@google.com, paulberry@google.com

Bug:
Change-Id: If5ff6dfbc5f8f724f657694a5e331b9fd07227fc
Reviewed-on: https://dart-review.googlesource.com/5280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2017-09-12 16:05:17 +00:00
Leaf Petersen 1c94f7a604 Reland and refactor fuzzy arrow hints.
This restores the functionality from https://codereview.chromium.org/3012593002/, with some small refactors.

The test breakage that caused the revert is fixed in https://codereview.chromium.org/3004143002/ .

Also adds a couple of drive by fuzzy arrow fixes.

BUG=
R=jmesserly@google.com

Review-Url: https://codereview.chromium.org/3006893002 .
2017-08-31 12:18:51 -07:00
Karl Klose d7a6ef9f64 Revert "Add a hint on static uses of fuzzy arrows."
This reverts commit 1f7c0d2c4c.

TBR=johnniwinther@google.com

Review-Url: https://codereview.chromium.org/3004113002 .
2017-08-31 08:30:22 +02:00
Leaf Petersen 1f7c0d2c4c Add a hint on static uses of fuzzy arrows.
This causes the analyzer to emit a hint message when fuzzy arrow
subtyping is used.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/3012593002 .
2017-08-30 15:27:26 -07:00
Dan Rubel 8786656783 map fasta error codes to analyzer
Rather than have multple fine grained error codes for each type
of modifier in each situation, this CL adds a new analyzer
ParserErrorCode.EXTRANEOUS_MODIFIER parallel to the fast parser
error code and updates the AstBuilder to generate that error
rather than ParserErrorCode.ABSTRACT_CLASS_MEMBER.

My goal is to review each analyzer error code similar to
ParserErrorCode.ABSTRACT_CLASS_MEMBER and map each to the same
ParserErrorCode.EXTRANEOUS_MODIFIER error code.

R=paulberry@google.com

Review-Url: https://codereview.chromium.org/2999303002 .
2017-08-25 09:00:18 -04:00
Konstantin Shcheglov 556b0284b3 Report compile time errors when assert initializers fail.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review-Url: https://codereview.chromium.org/3003363002 .
2017-08-24 14:48:15 -07:00
Dan Rubel d1385f099f support class native clause
R=ahe@google.com

Review-Url: https://codereview.chromium.org/2996163002 .
2017-08-22 07:42:56 -04:00
Devon Carew 69afd51bbe Add a hint to rename .analysis_options files.
BUG=
R=brianwilkerson@google.com, danrubel@google.com, scheglov@google.com

Review-Url: https://codereview.chromium.org/2993323002 .
2017-08-09 11:48:37 -07:00
Brian Wilkerson 471b7fd568 Emit a hint when using generic method comment syntax (issue 30356)
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2990383002 .
2017-08-08 09:12:26 -07:00
Brian Wilkerson defb2990d2 Add a test to ensure that error codes are not being missed and add missed error codes
R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2992243002 .
2017-08-04 07:45:46 -07:00
Erik Ernst 9336e199fd Re-land of CL 2990703002, adding fixes to analyzer_test and error_test.
This CL is identical to the reverted CL 2990703002 which implements
syntactic support for generalized void in the analyzer, plus two bug
fixes in pkg/analyzer/test/generated/parser_test.dart and
pkg/analyzer_cli/test/error_test.dart. In the former, a test on parsing
`void,` was changed to expect an error: _isTypeIdentifier on a lone
`void` will no longer return true, which is necessary because `void`
can now be used as a type annotation alone. Another test on `void x`
was added, which produces the behavior previously seen for `void,`.
In error_test, the error which is used throughout was changed from
`void foo;` to `var int foo;` (because the former is no longer an
error).

Review-Url: https://codereview.chromium.org/2992623002 .
2017-07-27 12:39:19 +02:00
Erik Ernst 2e73ce1187 Revert "Implemented support for generalized void in analyzer."
This reverts commit 1d44f5296a,
because it causes failures for the analyzer in parser_test, error_test.

Review-Url: https://codereview.chromium.org/2990723002 .
2017-07-26 18:18:04 +02:00
Erik Ernst 1d44f5296a Implemented support for generalized void in analyzer.
Changed the analyzer parser to accept usages of `void` which were
previously rejected as syntax errors: `void` can now be the type
annotation for a variable or parameter, and it can be an actual type
argument.

Removed affected error codes like VOID_PARAMETER, VOID_VARIABLE,
VOID_RETURN_FOR_GETTER and associated declarations (like checking
functions), and adjusted test cases to expect success rather than
compile time errors.

Adjusted generalized_void_syntax_test.dart (it had real errors like
`final` variables with no initializer etc. that were not detected
when tools would just reject the file as syntactically wrong).

R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2990703002 .
2017-07-26 17:45:13 +02:00
Florian Loitsch 377093841f Report an error when a part-of refers to an unnamed library.
Fixes #28522
BUG= http://dartbug.com/28522
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2931893004 .
2017-06-09 21:08:26 +02:00
Alexandre Ardhuin 617d0f53b6 add hint for @required (#29828) 2017-06-09 06:36:50 -07:00