Commit Graph

422 Commits

Author SHA1 Message Date
pq f5a0e185d2 invalid @doNotStore assignment analysis
Another pass at https://dart-review.googlesource.com/c/sdk/+/159841 (reverted) with a guarding type-check.



Change-Id: Ia270be4e880d71642a96c5ab93a306efba1ceedb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160961
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-01 02:38:17 +00:00
Sam Rawlins 44d88979ea Analyzer: Add LanguageCode, moving implicit-dynamic codes from StrongModeCode
Change-Id: Idd787c71137b7bdee9db3168b085861bf461bfd7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159400
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-08-25 17:01:50 +00:00
Brian Wilkerson d5088c0a8f Reland the CL to "Add a hint for the new Target annotation".
This reverts commit 50946855dc.

The bug that caused dartdoc to fail has been fixed by restoring the
creation of the invalid field. An issue has been created to update the
dartdoc package to stop using the invalid field, and the field will
need to be removed after dartdoc has been updated and pulled into the
SDK.

Change-Id: Ia7e282972e541a33b379872fbcd57a137a9c8a25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160120
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-25 16:53:10 +00:00
David Morgan 50946855dc Revert "Add a hint for the new Target annotation"
This reverts commit 351a1cc489.

Reason for revert: caused a generator to fail, b/166257389

Original change's description:
> Add a hint for the new Target annotation
> 
> Change-Id: I5d8723eead20bb68407ce2a23e8de6cb9ae8a4de
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159921
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>

TBR=scheglov@google.com,brianwilkerson@google.com

Change-Id: I16af4403867d31f731d1efafce2c0c2be405df9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160102
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-08-25 14:20:52 +00:00
Brian Wilkerson 351a1cc489 Add a hint for the new Target annotation
Change-Id: I5d8723eead20bb68407ce2a23e8de6cb9ae8a4de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159921
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-08-24 18:04:47 +00:00
David Morgan a249594de9 Revert "invalid @doNotStore assignment analysis"
This reverts commit 1e2772d106.

Reason for revert: Analyzer crash: b/165866426

Original change's description:
> invalid `@doNotStore` assignment analysis
> 
> TODO: follow-up with an `extensions_test`
> 
> Change-Id: Ie3d18229daf347885128d02e4b751436a8a0643f
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159560
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>

TBR=brianwilkerson@google.com,pquitslund@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Icfddee0e62fef3691b446ce92531f9281863880a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159841
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-08-24 07:26:06 +00:00
pq 1e2772d106 invalid @doNotStore assignment analysis
TODO: follow-up with an `extensions_test`

Change-Id: Ie3d18229daf347885128d02e4b751436a8a0643f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159560
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 23:58:06 +00:00
Konstantin Shcheglov 25edea3d8d Issue 43100. Verify local variable reads for null safety.
Bug: https://github.com/dart-lang/sdk/issues/43100
Change-Id: Ia8ece4de32f65d7912e534ce61936a45f2c768c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-08-20 15:50:50 +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 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
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
Paul Berry ff987cc0ad External variable support: do not allow initializing abstract fields/variables.
There are three ways to initialize a field/variable, so we have to
check for three error conditions:
- At the declaration site
- Via a field formal parameter
- Via a constructor initializer

Change-Id: I14caa38aaf2265966a19c68525f1458ff9d116f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158363
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-13 02:42:38 +00:00
Konstantin Shcheglov 022812983e Enforce uniqueness of ErrorCode.uniqueName
Remove duplicate ParserErrorCode(s).

R=brianwilkerson@google.com

Change-Id: I8c8e4e3433f7147a728888cf5735bbecbc8297c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158204
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-12 00:40:59 +00:00
Konstantin Shcheglov 2f031c7121 Report WRONG_NUMBER_OF_TYPE_ARGUMENTS_EXTENSION.
R=brianwilkerson@google.com

Change-Id: I4c56a4535c4ae26dec9aaae9791774ad3ace365c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-11 21:54:10 +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
Konstantin Shcheglov 8405d7c8e3 Remove dart2jsHint option, verifier, and tests.
R=brianwilkerson@google.com, devoncarew@google.com

Change-Id: I95b88940c862d463af03e85fcdf0f4bf81c2fbd5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157641
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-08-10 19:19:43 +00:00
Paul Berry 92315c4b2d Abstract field support: do not allow initializing abstract fields.
There are three ways to initialize a field, so we have to check for
three error conditions:
- At the declaration site
- Via a field formal parameter
- Via a constructor initializer

Fixes #42981

Change-Id: Ifc32a28ffb62d60fd2171d4980e88da9eebcb481
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157664
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-08-08 13:36:52 +00:00
Sam Rawlins d169af6f7d Analyzer: remove unnecessary this
Change-Id: I85a769e0c32159ac2a6422d3a60d160bda40d9b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156488
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-08-01 06:16:31 +00:00
Sam Rawlins b8ce4baf7e Remove 'checked mode' from checked_mode_compile_time_errors
Change-Id: I6576eb186149d540ce2dbc0e0aab7177ff4727be
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156484
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-07-31 19:20:58 +00:00
Mike Fairhurst 59600f2b46 [analyzer] Improve existing non-generative constructor errors
As opposed to the parent CL which creates a new error for cases where no
non-generative constructor is available at all, these improvements
include a bugfix to the previous error message.

The previous message was incorrect in saying 'expected {0} but factory found',
because the argument passed to '{0}' was the factory constructor that
was found, rather than any kind of expected constructor signature.
Fixed.

Also, for implicit constructors, break out the error message to
deliberately explicitly describe that this affects the implicit
constructor.

I considered making an error code for implicit super initializers as
well, (ie `class Foo extends Bar { Foo(); }`), but don't think it is
necessary/common/etc.

Change-Id: I0643ad00abbfb2848cbd2f8f1f83e7c33d4fb846
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155831
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-30 05:12:40 +00:00
Mike Fairhurst e0164ec47e [analyzer] Fix #25874, confusing error for extending Exception.
In the case of extending Exception, the raised error is around the
configuration of the constructors. However, there is no valid
configuration of constructors to be found, and therefore, the better
user facing message is to say that the class cannot be extended as
written.

Change-Id: I5950d438877c450c44cdc914f9f20d7779a64768
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154126
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-30 05:12:40 +00:00
Sam Rawlins f23f450e11 Analyzer: Move CONST_CONSTRUCTOR_PARAM_TYPE_MISMATCH to compile-time
Many of the tests were highly redundant. Subtyping has been
consolidated, so the tests don't need to cover a dozen different ways
to subtype a class.

Change-Id: I04448790d3a74690d0edb57f15146a6c3b8f2173
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156400
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-30 00:34:29 +00:00
Konstantin Shcheglov 8de8a1c226 Move codes from StaticTypeWarningCode into CompileTimeErrorCode.
They are all errors now.

Change-Id: If48d38e38e845fd5b5a950dd5514bf1cbbce03d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-27 16:44:15 +00:00
Sam Rawlins 1a829bbde0 Analyzer: Recategorize COULD_NOT_INFER as CompileTimeErrorCode
Change-Id: I2aec1fd6499fcbcc35e7cf9b765dd43559d3ef67
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155846
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-26 22:27:39 +00:00
Konstantin Shcheglov ba92b78acd Move errors from StaticWarningCode to CompileTimeErrorCode.
Bug: https://github.com/dart-lang/sdk/issues/42821
Change-Id: I153c48d7a2e4a02026928e6203aacf8f2dc029ba
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155849
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-26 04:19:25 +00:00
Sam Rawlins c65b444145 Analyzer: Move TOP_LEVEL_CYCLE to be a compile-time error
Also remove duplication with RECURSIVE_COMPILE_TIME_CONSTANT.

Also write some tests for TOP_LEVEL_CYCLE.

Change-Id: I33cb765236a83bd925f9f0c6e65ac9398761c699
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-24 15:11:38 +00:00
Sam Rawlins 6c9b885e57 Remove StrongModeCode.INVALID_PARAMETER_DECLARATION; it's redundant
You can see in the included test that we already report
`FIELD_INITIALIZING_FORMAL_NOT_ASSIGNABLE`.

Change-Id: Ib7c4177627120a31910d3929d61f5337cb869b1d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155281
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-23 20:30:50 +00:00
Sam Rawlins 8796382840 Analyzer: Move invalid_super_invocation to compile-time error
Change-Id: Id8be8473b2516cfc15c226edaaf25dadf3a90d3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155549
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-23 18:15:04 +00:00
Sam Rawlins 23cf1230d0 Analyzer: Re-categorize StrongModeCode.INVALID_CAST_* codes as CompileTimeErrorCodes
I found literally zero tests for INVALID_CAST_FUNCTION_EXPR, and I was
unable to write any code that triggers it. :/

The rest are classified as compile-time errors in CFE; I am confident
that "compile-time error" is the correct classification.

Change-Id: Ib0cf543b983f8e28b45d40cc9cd4dc9f14b2f387
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155302
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-22 00:34:45 +00:00
Sam Rawlins bbe6bb9823 Analyzer: Improve generator return error messages
Fixes https://github.com/dart-lang/sdk/issues/27468

In addition convert both ILLEGAL_ASYNC_GENERATOR_RETURN_TYPE and
ILLEGAL_SYNC_GENERATOR_RETURN_TYPE to CompileTimeErrorCodes.

Change-Id: I5f09f3d77dad52b4ba524c86b3e07ac5fac905fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154824
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-07-18 15:28:06 +00:00
Sam Rawlins d90daf9154 Analyzer: Report unused optional parameters of private functions
Fixes https://github.com/dart-lang/sdk/issues/29731

This change produces UNUSED_ELEMENT hints for optional parameters
for which no arguments are ever explicitly given, under the following
circumstances:

* parameter is for a constructor, method, or top-level function which
  is not accessible outside the library,
* function is never torn-off (all bets are off once its been torn off),
* method does not override a method in which the matching parameter is
  required,
* method does not override a method with a matching paramter, in which
  an argument is given for the matching parameter.

Change-Id: Idabf051f55140b62a440dc63ca0234f22598a5e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152730
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-17 19:30:27 +00:00
Sam Rawlins 907da64b02 Analyzer: Redefine NOT_INSTANTIATED_BOUND to be an error.
All StrongModeCodes are being redefined.

https://github.com/dart-lang/sdk/issues/33545

Change-Id: I247c6584eba386edfd7babecb08adf5ccc9344ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154748
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-17 13:42:58 +00:00
Sam Rawlins f58ef23d58 Analyzer: Remove unused DYNAMIC_INVOKE code
This code is never reported.

Change-Id: I452e75682c188b4d89e8415f1f4050b2765cd267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154744
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-07-16 21:46:04 +00:00
Brian Wilkerson d4ac7066b7 Improve diagnostic message when short circuiting (issue 42599)
Change-Id: I456bc50792dfdb30c281578d0d54ffa9e2af6474
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154161
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2020-07-15 21:19:49 +00:00
Konstantin Shcheglov ef147c0a95 Issue 42699. Stop reporting EXPORT_DUPLICATED_LIBRARY_NAMED and IMPORT_DUPLICATED_LIBRARY_NAMED.
Bug: https://github.com/dart-lang/sdk/issues/42699
Change-Id: Ie64405791f15a38f170206a11eabee176b6cbfad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154540
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-15 21:03:16 +00:00
Paul Berry 9f8aaf65c7 Issue an error if a prefix in a type name is shadowed by a local variable.
See #42620.

Change-Id: Ifd18c939082935390df0c2aa0bd724cf6f76c27c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153705
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-07-09 23:09:18 +00:00
Konstantin Shcheglov dfdc7e45c5 Report PRIVATE_SETTER.
Change-Id: I823582328b4b9cc63ac734e9ea1c9354175a6e18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153880
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-07-09 21:51:50 +00:00
Konstantin Shcheglov 39c94735a3 Report MIXINS_SUPER_CLASS.
Bug: https://github.com/dart-lang/sdk/issues/42256
Change-Id: I49c70d5a172062fed4d8663d95701ba855effda6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153823
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-09 19:05:52 +00:00
Konstantin Shcheglov 849cdb2ab4 Check for consistency of language version overrides between library and parts.
Change-Id: I209cbcda3d96c4e2f1f7a0352b563c886a22e687
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-07-09 00:42:42 +00:00
Sam Rawlins 648b5e9c68 Use ///-style doc comments in analyzer/lib
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: I573cb81dca6462c571bd6bf7bf309a46fd628967
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152610
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-26 17:58:50 +00:00
Konstantin Shcheglov 021a49e88c Update the way to get feature set and language version.
https://github.com/dart-lang/sdk/issues/42274
https://github.com/dart-lang/sdk/issues/42321

Change-Id: I5551ecd2803f9d26e720e5cf5671b3be8236bce9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151423
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-16 19:05:43 +00:00
Konstantin Shcheglov b7efcd276c Report NO_COMBINED_SUPER_SIGNATURE.
https://github.com/dart-lang/language/pull/975

Change-Id: I8ecd191efa84f17d36ea09ef1db33a401c67fda3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151093
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-06-15 17:42:45 +00:00
Sam Rawlins 294a2cffd1 Analyzer: print constructor name when constructor returns invalid type
Fixes https://github.com/dart-lang/sdk/issues/27387

Change-Id: I8ce81bab4c4601c5157977d3f43f73903dae7f8b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151200
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-15 13:52:56 +00:00
Sam Rawlins 32a93e2147 Analyzer: Remove error on class-used-as-mixin referencing super
Fixes https://github.com/dart-lang/sdk/issues/34806

Change-Id: I1cfd0b9c0699734b172aa62f7a04ab533a6cd03f
Fixed: 34806
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151099
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-06-13 15:11:25 +00:00
Sam Rawlins 56dbe294f2 Analyzer: Do not report const constructors with mixed in synthetic fields
Fixes https://github.com/dart-lang/sdk/issues/37810

Also report the offending fields in the error.

Change-Id: I8328bf5f16f56f1b70bbe4bdb7623ade6f11943c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151027
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-06-12 16:24:35 +00:00
Sam Rawlins 66e2b22d14 Analyzer: report conflicting extension type variables
Fixes https://github.com/dart-lang/sdk/issues/42216

Report when an extension declares a type parameter with the same name as the
extension.

Report when an extension declares a member with the same basename as the name
of any of the extension's type parameters.

Move tests into diagnostics/.

Move tests for RECURSIVE_INTERFANCE_INHERITANCE.

Change-Id: If19041571008b9b14122d9ff458d1d30ea0ff034
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/150270
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-06-08 05:44:12 +00:00
Paul Berry 275b922ee8 Revert recent parser fixes
Commit 1f9b5c1996 causes tests to fail
in angular when rolled into internal sources; the other two commits
need to be reverted as well to avoid merge conflicts.

This reverts commit 1f9b5c1996.
This reverts commit c40b24da48.
This reverts commit 96df1f9e6c.

Change-Id: Ic4e55181ef60e825ce4409a9a9528ecbf19c39c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/147822
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-12 22:02:09 +00:00
Jens Johansen 96df1f9e6c [parser] Add ErrorToken for ignored (unmatched) end parenthesis, brackets etc
Change-Id: Idb57295700988d71321743af9782134b02562311
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146240
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-05-11 14:46:47 +00:00
Sam Rawlins 018dab4568 Analyzer: Report a constructor which redirects to a constructor of an abstract class
Fixes https://github.com/dart-lang/sdk/issues/37552 and
fixes https://github.com/dart-lang/sdk/issues/34370

Change-Id: I75e68157cf7e6e9824353c307a8e9f6669f8ea82
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145571
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-05-02 03:53:55 +00:00
Konstantin Shcheglov dd033a6ab7 Report HintCode.NULLABLE_TYPE_IN_CATCH_CLAUSE.
Change-Id: I747fa9992243f811b4a98320a4ebd169f35daec0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/143326
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-04-13 20:21:42 +00:00