Konstantin Shcheglov
50de84a3fb
Issue 45467. A setter in lexical scope shadows inherited getter.
...
Bug: https://github.com/dart-lang/sdk/issues/45467
Change-Id: I1c7c67fcc61f9cc2661ba4a2d73da9634a285d41
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-26 00:24:56 +00:00
Brian Wilkerson
eb1ce5d640
Remove some unnecessary null checks
...
These were found using the unnecessary-null-checks lint. It has a bug
that prevents us from enabling it at the moment, but we should consider
enabling it once the bug has been fixed.
Change-Id: Ice250b5a6a8723c5f08dec5b07ae738e17c842cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196550
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2021-04-24 18:22:43 +00:00
Brian Wilkerson
5be0438e47
Make local variables that hide fields be final (analyzer)
...
Change-Id: I4cb41aec1757e133751979d3c0cdc697ccafc4a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196780
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2021-04-24 18:04:04 +00:00
Konstantin Shcheglov
6a203ce308
[analyzer] add error check in not binary operator.
...
try to fix: https://github.com/dart-lang/sdk/issues/45659
Closes https://github.com/dart-lang/sdk/pull/45751
https://github.com/dart-lang/sdk/pull/45751
GitOrigin-RevId: ae4544cd41743ee1a5e0576ee64dd9544990b3d7
Change-Id: Ie4ccb05aa8f3df2d55e474056f69c56d6cca6a62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195882
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-24 00:04:32 +00:00
Paul Berry
b10a592341
Add a url field to DiagnosticMessage.
...
This paves the way for allowing analyzer and analysis server clients
to format diagnostic message URLs in a special way (e.g. to make them
clickable).
Note that DiagnosticMessage is part of the public API of the analyzer,
so I've retained the old behavior in a deprecated fashion to avoid
breaking clients that don't yet handle diagnostic messages containing
URLs.
See
https://dart-review.googlesource.com/c/sdk/+/193749/comment/86d1ce4b_77a60b1e/
for additional discussion.
Change-Id: Iae9d43a2be7dbc67cb7cb82afe0a7824043d6113
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196101
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-23 20:34:32 +00:00
Konstantin Shcheglov
ae39dee6fa
Fix for invoking a generic method of a generic class from legacy code.
...
Bug: https://b.corp.google.com/issues/185971662
Change-Id: I71f4f251770e6e371bd6035911ca7c9562610540
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196342
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-22 17:22:56 +00:00
Jia Hao Goh
2d632d0eac
Ignore return statements for @doNotStore in tests
...
Bug: #45594
Change-Id: I83574cc456d6259c0627d902c4bbfb2310055caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196243
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Phil Quitslund <pquitslund@google.com >
2021-04-22 00:22:51 +00:00
David Morgan
d8479de94b
Revert "Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER"
...
This reverts commit 649f7cf689 .
Reason for revert: Breaks google3: b/185875256
Original change's description:
> Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
>
> Change-Id: I947e1edb042825a5cfc3394d2554ad3272f86b91
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195302
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: Ic019fa570f048e213290ac04d02d1b4655415b47
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196282
Reviewed-by: David Morgan <davidmorgan@google.com >
Commit-Queue: David Morgan <davidmorgan@google.com >
2021-04-21 10:22:18 +00:00
David Morgan
d46cc75617
Revert "Issue 45672. Report constant errors when null value where non-nullable type is expected."
...
This reverts commit 9abc59e74c .
Reason for revert: Breaks google3: b/185915025
Original change's description:
> Issue 45672. Report constant errors when null value where non-nullable type is expected.
>
> Bug: https://github.com/dart-lang/sdk/issues/45672
> Change-Id: I9d006955523bf470c762fde57444e3596e4dccae
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196042
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
TBR=scheglov@google.com ,brianwilkerson@google.com
Change-Id: I0b16cf82414623a2fbda17813aeb0c24f080e568
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/45672
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196281
Reviewed-by: David Morgan <davidmorgan@google.com >
Commit-Queue: David Morgan <davidmorgan@google.com >
2021-04-21 06:44:41 +00:00
Konstantin Shcheglov
375e878c35
Update nullability for TypeParameterType in tryPromoteToType()
...
Change-Id: Ifc8c32e3540577437c6448fa943d8cbbfebf0b62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196105
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-20 23:02:08 +00:00
Konstantin Shcheglov
9abc59e74c
Issue 45672. Report constant errors when null value where non-nullable type is expected.
...
Bug: https://github.com/dart-lang/sdk/issues/45672
Change-Id: I9d006955523bf470c762fde57444e3596e4dccae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196042
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-20 17:54:10 +00:00
Konstantin Shcheglov
649f7cf689
Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_GETTER
...
Change-Id: I947e1edb042825a5cfc3394d2554ad3272f86b91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-20 04:53:39 +00:00
Konstantin Shcheglov
9dd51c80bd
Deprecated getFile() and getSourceKind(). Added getFile2() instead.
...
R=brianwilkerson@google.com
Change-Id: Ia52967472077abd73cdf4df1320dd71b5dee98b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-19 23:57:19 +00:00
Konstantin Shcheglov
048073dbd2
Synthetic constructor of mixin applications are not redirecting, they call super().
...
...according to `12.3 Mixin Application` of https://spec.dart.dev/DartLangSpecDraft.pdf
Bug: https://github.com/dart-lang/sdk/issues/45672
Change-Id: Ia1fea1f0c962ccb5aac0a3ad5ab69bc386ec4ef7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-19 22:32:48 +00:00
Konstantin Shcheglov
5dd02f0583
Add getParsedLibrary2(), deprecate getParsedLibrary() and other parse related
...
Change-Id: I585fa1f01b71522dc99ba86c2b9e20da256b2d27
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-19 15:52:39 +00:00
Konstantin Shcheglov
5168b3eb96
Add getErrors2(), deprecate getErrors().
...
R=brianwilkerson@google.com
Change-Id: I84e22fa8be63d517fde4c31ff79724362798cda9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195764
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-19 02:56:30 +00:00
Konstantin Shcheglov
2622d728ae
Add getLibraryByUri2(), deprecate getLibraryByUri().
...
R=brianwilkerson@google.com
Change-Id: I6769ccb5767408490934693cc9019d5af1d8d8d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-19 00:19:32 +00:00
pq
f4d136eb14
skip @doNotStore check in test contexts
...
Fixes: https://github.com/dart-lang/sdk/issues/45594
Change-Id: Ie56284d0ead5f7de4fb49dedb1085ea39972fe1b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195720
Commit-Queue: Phil Quitslund <pquitslund@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-18 03:00:07 +00:00
Konstantin Shcheglov
db2aceaa42
Add getResolvedLibrary2(), deprecate getResolvedLibrary().
...
Change-Id: If502203708ed4c6a64e7054c2b12970eac11755b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195497
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-17 16:51:07 +00:00
Konstantin Shcheglov
8161b299c9
When in Cider 'part of some.name;' try to find the library as a sibling file.
...
Change-Id: I489bac7ebaaa5b61e7972f1ea01a4613220bde7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192980
Reviewed-by: Keerti Parthasarathy <keertip@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-16 23:56:47 +00:00
Konstantin Shcheglov
26d9fbbd04
Add getResolvedUnit2(), deprecate getResolvedUnit().
...
Change-Id: I0217fefb2747f2f9bd757bc041b53acaf3d1a8f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195495
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-16 21:33:54 +00:00
Konstantin Shcheglov
84df6991f6
Issue 45716. Store declarations of referenced elements for checking for unused elements.
...
Bug: https://github.com/dart-lang/sdk/issues/45716
Change-Id: I7fb41fe8d1bf14a51663e726bb861122be11b0a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195496
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-16 20:38:57 +00:00
Nate Bosch
0a5525fdb1
Drop analyzer dependency on test_api
...
The only usage was to pick up `expect` which is exported through the
preferred import `package:test/test.dart`.
Change-Id: I0650901114bdc99e67e5801da636f309ff55f8da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195491
Auto-Submit: Nate Bosch <nbosch@google.com >
Commit-Queue: Nate Bosch <nbosch@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-15 22:08:07 +00:00
Paul Berry
0ccb2771a3
Analyzer: change extent for assignability errors with named arguments
...
Previously, if a type mismatch occurred on a named argument, e.g.:
int.fromEnvironment('foo', defaultValue: 'BAD')
the error would be reported on the entire NamedExpression
(`defaultValue: 'BAD'` in this example). Now, the error is just
reported on the expression (`'BAD'` in this example). This makes the
analyzer behavior more self-consistent (since now assignability errors
are now consistently reported at the site of the expression that can't
be assigned). It also makes the analyzer behavior more consistent
with the CFE.
This will make it possible, in a follow-up CL, to eliminate a lot of
the inconsistencies between analyzer and CFE in the "why not promoted"
ID tests.
Change-Id: I17db256959d730a22a5766f65d5c0736b627f244
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195489
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-04-15 21:38:37 +00:00
Konstantin Shcheglov
4dc165f7fd
Add getUnitElement2(), deprecate getUnitElement().
...
Change-Id: Ib1ed93f215356442ca9db5b8ed5fab99667e996e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195361
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-15 17:16:27 +00:00
Paul Berry
3397720738
Analyzer: Add id testing for inferred variable types
...
This parallels the test introduced in
https://dart-review.googlesource.com/c/sdk/+/195260 , but it tests the
analyzer rather than the CFE.
Change-Id: I7751abfcad0e91bf903a5dae2136b80c6714ea35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-04-15 16:51:47 +00:00
Paul Berry
8af652ce3d
Analyzer: update id testing for inferred type arguments to handle collection literals.
...
The ID tests for inferred type arguments now include tests for
collection literals, e.g.:
/*<dynamic>*/ [];
The analyzer ID testing code needs to be updated to handle test cases
like these.
Fixes trybot failure with
pkg/analyzer/test/id_tests/inferred_type_arguments_test.
Bug: https://github.com/dart-lang/sdk/issues/45717
Change-Id: I338814acccf3e080bbf8cf167041c52d96ba19cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195482
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-04-15 14:23:47 +00:00
Paul Berry
ed9def1467
Analyzer: Add id testing for inferred type arguments
...
This parallels the test introduced in
https://dart-review.googlesource.com/c/sdk/+/195020 , but it tests the
analyzer rather than the CFE.
Change-Id: I5ea1b873561f159a0549acbfdf8c1e639b733435
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195420
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2021-04-15 12:16:17 +00:00
Konstantin Shcheglov
c3c371b971
Remove Either2.mapAsync(), test toString().
...
We can use just `map()` with the right return type.
R=brianwilkerson@google.com
Change-Id: I9b05e75babd9019876a6194d6b49bf2b7e3982f7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-14 21:43:06 +00:00
Konstantin Shcheglov
a505f2dc55
Replace FileState.external() with Either2<FileState?, ExternalLibrary>. (try 2)
...
Global presubmit looks green.
https://test.corp.google.com/ui#id=OCL:368340336:BASE:368343419:1618375425236:9f9f89c1
Change-Id: Idaf44452f83f00102cc14579ccdd688bb7e14dbb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195190
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-14 18:44:56 +00:00
Konstantin Shcheglov
6628a0eca5
Stop reporting StrongModeCode.TOP_LEVEL_FUNCTION_LITERAL_BLOCK
...
Change-Id: I4e3aff4a16015910e1f3cb48e8dd12892e63531a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-14 18:38:05 +00:00
Konstantin Shcheglov
cc265dc81c
Stop reporting StrongModeCode.TOP_LEVEL_INSTANCE_METHOD
...
I will work on removing other such hints in following CLs.
Change-Id: I792ec4dde8b11c9e6117bb5d63ef9583cb86fadf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195185
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-14 00:43:08 +00:00
Konstantin Shcheglov
60a53afc5e
Revert "Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult."
...
This reverts commit 83ca0e87a0 .
Reason for revert: breaks google3
Original change's description:
> Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult.
>
> Change-Id: Iab3a8c6c81ace30049a93d0a453e2473634ba07a
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195058
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
TBR=scheglov@google.com ,brianwilkerson@google.com
Change-Id: Iecaa81064450f536a45235d4d79d3b212a93918b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195188
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-14 00:41:59 +00:00
Konstantin Shcheglov
1dcccbe30b
Revert "Replace FileState.external() with Either2<FileState?, ExternalLibrary>."
...
This reverts commit 1605740703 .
Reason for revert: breaks google3
Original change's description:
> Replace FileState.external() with Either2<FileState?, ExternalLibrary>.
>
> Change-Id: I092da57fc3ca57479ea6088ac1a174677c80270b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195170
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
TBR=scheglov@google.com ,brianwilkerson@google.com
Change-Id: I0fa3817b6022c0a4a767e48486fac2a6783cd5a0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195186
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-13 23:18:49 +00:00
Konstantin Shcheglov
1605740703
Replace FileState.external() with Either2<FileState?, ExternalLibrary>.
...
Change-Id: I092da57fc3ca57479ea6088ac1a174677c80270b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195170
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-13 23:16:43 +00:00
Konstantin Shcheglov
83ca0e87a0
Make AnalysisResult.path non-nullable, more non-nullable for ParsedLibraryResult and ResolvedLibraryResult.
...
Change-Id: Iab3a8c6c81ace30049a93d0a453e2473634ba07a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195058
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-13 18:05:28 +00:00
Daco Harkes
f162db3ba7
[analyzer/ffi] Support Unions
...
This CL does not add unions to `dart:ffi` yet, only to the mock
SDK in the analyzer for testing the analyzer. This means we can review
and land it separately.
Also, this CL fixes some tests to not use nullable fields in Structs.
Bug: https://github.com/dart-lang/sdk/issues/38491
Change-Id: Ia972f31475859aa57e012adf39b636919995b183
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194788
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-12 16:50:16 +00:00
Keerti Parthasarathy
1668734697
Add a method to resolve a library
...
Change-Id: I0eba5b60bb46fa7dfbceb2b26e0d1d5ec3ae3ebf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194015
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Keerti Parthasarathy <keertip@google.com >
2021-04-06 21:27:43 +00:00
Konstantin Shcheglov
778c2361c3
Issue 45579. Report WRONG_NUMBER_OF_TYPE_ARGUMENTS and TYPE_ARGUMENT_NOT_MATCHING_BOUNDS.
...
Bug: https://github.com/dart-lang/sdk/issues/45579
Change-Id: I757f4d782895fb1a9c89d8238a7929e12d6a6eed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194000
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-03 17:46:16 +00:00
Xavier H
9482dd6c6c
Analyzer pkg: output required keyword in ToSourceVisitor
...
This fix `SimpleFormalParameter` in `ToSourceVisitor` to output `required` keyword
Closes https://github.com/dart-lang/sdk/pull/45561
https://github.com/dart-lang/sdk/pull/45561
GitOrigin-RevId: cbdf667aaa983258dd9b5da4323299732c056e72
Change-Id: I2abe0e34b832aed997df6c411b197a12e2f9023a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193839
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
2021-04-02 16:31:42 +00:00
Sam Rawlins
5e040a20f8
analyzer: Improve span of use_of_nullable_value errors
...
This changes the span reported from the _receiver_ to
the _use_ (method name, property name, operator token).
I think this change is overall an improvement.
Specifically, its a great improvement for cmdline
output, where the receiver and the "use" are on
different lines.
One possibly weird change is that if the operator is `[]`,
then I only highlight the `[` character. I don't know if
there is a better place, and I think this is fine.
Fixes https://github.com/dart-lang/sdk/issues/43708
Change-Id: Ie66ddf04b4904a367575193106385dd63ee39985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/188680
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-04-02 02:43:48 +00:00
Konstantin Shcheglov
e673c19820
Resolve annotations via type aliases.
...
Change-Id: I6d22e06775d31856fc85a350892efe15208832f5
Bug: https://github.com/dart-lang/sdk/issues/44838
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193743
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-04-01 02:52:43 +00:00
Konstantin Shcheglov
fd63463daf
Don't create additional ContextRoot(s) when nested in an existing root.
...
Change-Id: I52a0b4f32b7d84d3c3287f94a6e4d7c488374a35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193528
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-31 16:14:59 +00:00
Konstantin Shcheglov
3ce196935e
Implement inference via type aliases with aliased InterfaceType.
...
Change-Id: I1d2bba09f19468bc8e095c5ef4a39c09365eb2a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193450
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-30 23:39:57 +00:00
Konstantin Shcheglov
8c4d10d9cf
Tests for IMPLEMENTS_SUPER_CLASS and MIXINS_SUPER_CLASS via type alias.
...
Also a small tweak for reporting repeated implements/with.
Bug: https://github.com/dart-lang/sdk/issues/45489
Bug: https://github.com/dart-lang/sdk/issues/45526
Change-Id: I6b3e7cb545ce5c63b8facd8b2e55593a45196779
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-30 21:42:31 +00:00
Paul Berry
20acfbc876
Move checkIndexExpressionIndex checking to resolver.
...
In order to implement "why not promoted" functionality index
expressions, we need to call checkIndexExpressionIndex from the
resolver, so that we can pass it failed promotion information. So
move it into the ErrorDetectionHelpers mixin.
Bug: https://github.com/dart-lang/sdk/issues/44898
Change-Id: Idc70e3421142da1d3100c288c912b6483a91b28c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193087
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2021-03-30 18:24:11 +00:00
Konstantin Shcheglov
fa243e700a
Issue 45492. Report TYPE_ARGUMENT_NOT_MATCHING_BOUNDS for not regular bounded type as a type alias body.
...
Bug: https://github.com/dart-lang/sdk/issues/45492
Change-Id: I303a7066c356e645d549960f66c1d7b8d50f307a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193452
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-30 16:50:11 +00:00
Konstantin Shcheglov
fcb9bfb81b
Report IMPLEMENTS_REPEATED and ON_REPEATED also when via type alias.
...
Change-Id: Ied864fe708b6f00976e0629f8f3e514b693b5129
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193451
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2021-03-30 16:50:02 +00:00
Daco Harkes
4ba4fd3f1d
[analyzer/ffi] Inline array annotation const dimensions
...
Moves the Array forwarding constructors and _ArraySize class out of
the patch files so that the analyzer can reason about them.
(The analyzer does not include patch files, because it does not know
whether it's analyzing for VM or JS backend.)
Closes: https://github.com/dart-lang/sdk/issues/45507
Change-Id: Ia0eb4bbca40b906a1e636714f53c5c73dcfc3cad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193403
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Daco Harkes <dacoharkes@google.com >
2021-03-30 00:28:57 +00:00
Daco Harkes
86635c76fa
[analyzer/ffi] Fix NPE in ffi_verifier
...
Closes: https://github.com/dart-lang/sdk/issues/45498
Change-Id: I836c52b03800bc8282e5f26168f1feab93068b8c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193304
Commit-Queue: Daco Harkes <dacoharkes@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2021-03-29 15:56:18 +00:00