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
Paul Berry
b7d139a626
External variable support: add a notion of external top level variables to the AST and element model.
...
In follow-up CLs I will update error reporting logic.
Change-Id: Iee42088beffee3915a2ef6a4c8cb5c1031535d4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158149
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-12 15:59:24 +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
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
d4e4abdef6
External field support: add a notion of external fields to the AST and element model.
...
In follow-up CLs I will update error reporting logic.
Change-Id: Id07b861aa117b93e0c869ad0b52c048085706ee6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-10 21:54:54 +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
c2379a800a
Move more tests to PubPackageResolutionTest.
...
R=brianwilkerson@google.com
Change-Id: Ic6c37d069323cc06c6ab630757625a7e0b072200
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157640
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-06 22:30:39 +00:00
Paul Berry
b5a3292260
Abstract field support: add a notion of abstract fields to the AST and element model.
...
In a follow-up CL I will update error reporting logic.
Change-Id: I6fd2916c24a531b1f41bd2872301ffec1fdb8722
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/157382
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-06 02:19:46 +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
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
Sam Rawlins
d4f912dadb
Analyzer: Move all remaining tests from compile_time_error_code.dart and remove
...
Change-Id: Id3c2a3df6aea0437b9e0798040ac76fa96a01215
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-29 02:51:50 +00:00
Sam Rawlins
de0848e7ea
Analyzer: Move tests out of old test file into diagonstics.
...
* Add non_const_call_to_literal_constructor to test_all.
* Clean up non_const_call_to_literal_constructor to avoid unused variables.
* Update NON_CONST_MAP_AS_EXPRESSION_STATEMENT tests to be failing tests.
Change-Id: I1ca9e18372c7b5acc7b8670f81ed89ed0aa18825
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155927
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-07-27 22:18:48 +00:00
Konstantin Shcheglov
f64d6dbb4f
Move and refactor LUB tests.
...
R=brianwilkerson@google.com
Change-Id: Ie17fd6f48d76222107a122c17ce58c00f5eeb186
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156062
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-27 21:34:38 +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
01c217ecc9
Analyzer: Move tests for 5 codes to diagnostics/
...
Change-Id: I6545819d659f18b0bbd0cf79b10c564a0bd66777
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155848
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-27 04:56:14 +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
Konstantin Shcheglov
5171534e81
Scope tweaks. Report REFERENCED_BEFORE_DECLARATION in more places.
...
Change-Id: Iac395adf15c3f636e3e7e7241e0573f83ab61372
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155304
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-22 19:15:59 +00:00
Konstantin Shcheglov
6f8ce20c99
Move asInstanceOf(ClassElement) to DartType.
...
This follows to the change to the specification.
https://github.com/dart-lang/language/pull/1106
R=brianwilkerson@google.com
Change-Id: I6575f201161c454de98e9bcbec74b9974d91d062
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155242
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-22 01:22:05 +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
Konstantin Shcheglov
204d22467b
Use WithNullSafetyMixin instead of direct AnalysisOptionsImpl.
...
Change-Id: Ib950d298e3008e708398cb6e8d8d0b3e57114dac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-21 16:16:28 +00:00
Konstantin Shcheglov
86ec742832
Switch to new Scope(s).
...
No much changes to resolution itself, only to the way how we create
scopes. But we still use `lookupIdentifier` that is basically the old
approach to resolution.
This also moves the fix of https://github.com/dart-lang/sdk/issues/42620
to TypeNameResolver.
I will continue improving in following CLs.
Change-Id: I89bae5afe0a7978aba9fe9bf7c8bf08fb59b1440
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-21 01:37:34 +00:00
Konstantin Shcheglov
7d3252800b
Infer void return type for FunctionExpression.
...
https://github.com/dart-lang/language/pull/1092
Bug: https://github.com/dart-lang/sdk/issues/42720
Change-Id: I7ce44a066382c63e22debbcb652a717b5230b267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-17 16:03:00 +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
Konstantin Shcheglov
058fa167c8
Implement LibraryScope as an adapter for the new scope.
...
Change-Id: Ic69dcec3b7b4263b13909b61dba49b1814116759
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154640
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-17 02:35: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
Sam Rawlins
a48bebea1e
Analyzer: Move tests for 7 more codes to diagnostics/
...
Change-Id: I1b646cff5bbc05538825434ce933e87e7ca075bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154365
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-07-15 12:22:13 +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
Sam Rawlins
450d611068
analyzer: Move tests for 9 codes to diagnostics/
...
Change-Id: Ib933f7923a0eb08db80839bf0490adc22d38ef14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154303
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-07-14 04:32:33 +00:00
Sam Rawlins
39f39c04b8
analyzer: move tests for 4 codes to diagnostics/
...
Change-Id: Ida28ae6ef39314b724932c5ae1a9a3aa4a72a17f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154220
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-13 14:55:15 +00:00
Sam Rawlins
8e69e0d810
Analyzer: Move tests for 10 codes to diagnostics/
...
Change-Id: I331ca61293620d7c5d0b0d3e41387c10a22c6663
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/154143
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-07-11 21:50:13 +00:00
Sam Rawlins
6d06476bae
Analyzer: Report generators with void return types.
...
Fixes https://github.com/dart-lang/sdk/issues/32192
This has been illegal for some time. This change updates the analyzer
to match the behavior of CFE.
Also move the relevant tests to diagnostics/
Change-Id: I4539aeb65708e2594c52288a6b4584ba7e5455e4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153066
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-11 03:02:42 +00:00
Sam Rawlins
6e687d1d74
analyzer: move tests to 4 new test files in diagnostics/
...
Change-Id: Ied68dc6a383c7ca0a44dbcd8381f3a94832d44fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153903
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-07-10 17:24:05 +00:00
Konstantin Shcheglov
e52a8beb6b
Report error for generators with return type void.
...
Bug: https://github.com/dart-lang/sdk/issues/32192
Change-Id: Ib31205207def253dc89802898a899b3555ecc28d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153953
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-10 15:09:29 +00:00
Konstantin Shcheglov
f2cbec8010
Check for unnecessary_parenthesis in analyzer.
...
R=brianwilkerson@google.com
Change-Id: I2e8af156a190b51741d60fdb0217101c15306a79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-08 21:46:16 +00:00
Sam Rawlins
42d2996773
Analyzer: Move NON_BOOL_* tests to diagnostics/
...
Change-Id: I5bc58d78bf4f15e860759176d2e6abc670666e46
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-07-06 00:49:10 +00:00
Konstantin Shcheglov
69aba23371
Move TypeSystemImpl to src/dart/element/type_system.dart
...
R=brianwilkerson@google.com
Change-Id: I0d9acad041c1038f6f2be6c09855488287ba5e97
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-05 16:44:59 +00:00
Konstantin Shcheglov
326f7b4a8f
Remove DartSdk.useSummary.
...
Initial: https://dart-review.googlesource.com/c/sdk/+/149495
Reverted: https://dart-review.googlesource.com/c/sdk/+/149687
Change-Id: Ibd3f1af1aef83adc35f77cfbda66e07c5ae99922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-03 15:56:41 +00:00
Konstantin Shcheglov
9cfdc02e58
Stop depending on exports from generated/resolver.dart
...
We cannot remove them completely just yet, there are users in google3.
But this CL will allow experimenting internally to track these users
and update them similarly.
R=brianwilkerson@google.com , devoncarew@google.com
Change-Id: Ic588b2873f9d5202783c8991f58e86bab28bd47e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-07-03 15:55:41 +00:00
Sam Rawlins
f19ed288ed
Analyzer: Move INVALID_ASSIGNMENT tests to diagnostics
...
Change-Id: I111c64bb743dfb531e05be8594cab72c36866274
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153181
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-07-02 16:29:49 +00:00
Konstantin Shcheglov
6e9aa86d6f
Stop using AnalysisOptions.signature and multiple paths in SdkDescription.
...
Basically reduce it to a single path.
R=brianwilkerson@google.com
Change-Id: Ia532a5c7f6ae1464b77c5e9d23b3aaa7e85a6bf0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152710
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-06-29 17:50:14 +00:00
Sam Rawlins
c68fd58513
Use ///-style doc comments in analyzer/test
...
Bug: https://github.com/dart-lang/sdk/issues/33892
Change-Id: If61e07fda4d74b1e5171d22403b156855cd00596
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152701
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Samuel Rawlins <srawlins@google.com >
2020-06-26 18:45:05 +00:00
Konstantin Shcheglov
2ec47ad273
Use ElementKind.ENUM for enums.
...
There was a crash internally, caused by the fact that when we have
duplicate name for class and enum, during linking we put them into
different Reference bucket - @class and @enum, and also inside
the class, the reference to its name is the class.
But when we resolve, we check equality of elements using not
references, but locations. So, we need to make sure that their
kinds are also different, so go into different bucket, and so
not equal.
When they are InterfaceType and equal, we would try to match
type arguments against the wrong number of type parameters and crash.
Change-Id: Iee3f8691adac65d4b0395ceec7fc7250f96afa88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-06-25 00:20:31 +00:00
Sam Rawlins
10c5c113f3
Analyzer: Allow factory const ctor with non-const final fields
...
Fixes https://github.com/dart-lang/sdk/issues/36315
Change-Id: I010d4d6e855e243931f34e9dc55d537551dc9cb9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151661
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-06-18 18:17:06 +00:00
Konstantin Shcheglov
60bb0d3a41
Separate current and to restrict FeatureSet(s) in scanner.
...
Bug: https://buganizer.corp.google.com/issues/159207726
Change-Id: I41b4c79590dccd05d8b0fa42d296f00a3c3ee229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151620
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-06-17 23:32:31 +00:00
Konstantin Shcheglov
d279cb47b5
Enforce sorting in analyzer/.
...
Change-Id: If7e76e442e64cd4991b80c3993e3da10bb3a19ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151462
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-06-17 05:04:30 +00:00