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
Konstantin Shcheglov
69387f9d93
Issue 43268. Report warnings for Ext(c)?.foo() when 'c' is non-nullable.
...
Bug: https://github.com/dart-lang/sdk/issues/43268
Change-Id: I8b36e3e112eb91dc5d56e98f657f2c77bf761ada
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161143
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-31 22:05:30 +00:00
Konstantin Shcheglov
58ff2d0fe0
Change AssignmentExpression tests to assertAssignment().
...
Change-Id: If7cbb0584bfbf248ea79fe827626f4189d2f1c39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161041
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-31 16:13:38 +00:00
Konstantin Shcheglov
d45a532e7c
Update isNullable() and isNonNullable() to support TypeParameterType(s) with promotedBound.
...
Change-Id: If5abff641631cde16d344f29ede8c2435babd32f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160941
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-28 22:39:49 +00:00
Konstantin Shcheglov
8ae9842e12
Deprecate ElementAnnotation.constantValue
...
R=brianwilkerson@google.com , pquitslund@google.com
Change-Id: Ifae6a614c20b703d9614d7ccc2f8b254bafcb070
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160942
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Phil Quitslund <pquitslund@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-28 21:52:19 +00:00
Konstantin Shcheglov
8812673f1b
Set readElement/Type and writeElement/Type for PrefixExpression.
...
Change-Id: I4238b088f7ecd5779a2638c86a519d1b95a05e83
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160787
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-28 18:38:28 +00:00
Konstantin Shcheglov
5f3298eeac
Set readElement/Type and writeElement/Type for PostfixExpression.
...
R=brianwilkerson@google.com
Change-Id: I449503648192e4b2d1d65304d65a12f74d589bcc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160785
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-28 14:45:08 +00:00
Sam Rawlins
94c18e3dc5
Analyzer: Replace the use of package:html with a custom XML parser.
...
From the dartdoc: Android Manifest files are written in XML. In order
to validate an Android Manifest file, however, we do not need to parse
or retain each element. This parser understands which elements are
relevant to manifest validation. This parser does not validate the XML,
and if it encounters an error while parsing, no exception is thrown.
Instead, a parse result with [ParseResult.error] is returned.
Change-Id: I1aeb79f098aab2b4ca9b0ff54b027d41744c65ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160182
Commit-Queue: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-27 22:29:07 +00:00
Brian Wilkerson
1bbc412460
Add a method to WorkspacePackage to access the packages available to the receiver
...
Change-Id: Ib96e8bc05e848acda6b4c66f7080d106966e580e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160181
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-27 21:47:07 +00:00
Konstantin Shcheglov
59db5cfa6c
Issue 43214. Report EXTENSION_OVERRIDE_WITH_CASCADE on the override.
...
R=brianwilkerson@google.com
Bug: https://github.com/dart-lang/sdk/issues/43214
Change-Id: I66c33e535ba4c689cb6d9171493e9605728b76cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160701
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-27 20:27:27 +00:00
Konstantin Shcheglov
893481591a
Store readElement/Type and writeElement/Type in AssignmentExpression.
...
Change-Id: Ibe0eea6126c7e85cdfefa09652228b5a89b522cd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160444
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-27 20:22:14 +00:00
Paul Berry
2cb426f9fc
Fix context type for compound operators.
...
This is partially in support of the new numeric typing rules for null
safety, however it turned out that the anaylzer wasn't setting the
context type properly even in legacy code. I've fixed both legacy and
null safe behaviors and included tests to cover both.
Fixes #39642 .
Bug: https://github.com/dart-lang/sdk/issues/39642
Change-Id: Ie4d0936d335b1f750eae4febe76f2b8879c228b1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159965
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-26 18:21:05 +00:00
Konstantin Shcheglov
a717fd41e3
Issue 42379. Allow null-shorting only for increment operators in prefix expressions.
...
Bug: https://github.com/dart-lang/sdk/issues/42379
Change-Id: I366702f144a4350bed6b83c5c0936359aeeae2c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-25 23:05:03 +00:00
Konstantin Shcheglov
a46f6cb570
Support for SDK 2.9 and null safety.
...
Change-Id: I3e5cd4d8d3794c164d46c8b9eb59a376070edbd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160143
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-25 23:03:53 +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
Konstantin Shcheglov
5c9d9f8616
Don't report INVALID_NULL_AWARE_OPERATOR where INVALID_OPERATOR_QUESTIONMARK_PERIOD_FOR_SUPER is already reported.
...
Change-Id: I016821804d062f8c07103d4107b88222b1e2a92e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159966
Reviewed-by: Samuel Rawlins <srawlins@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-25 15:16:00 +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
Paul Berry
607e7d1bf2
Null safe numbers: hook up inference rules for method calls.
...
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: Ie5603b3804af6d740dde361ee8ff2537b0f0d35c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159421
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-25 03:42:08 +00:00
Paul Berry
9af30dbb06
Null-safe numbers: implement inference rules, hook up for binary operators.
...
A future CL will hook up the inference rules for method calls (`clamp`
and `remainder`).
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: Iefa36a369ce11726fc316ef46ff7d9bcb0e21da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159403
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-25 03:42:08 +00:00
Paul Berry
8572a26bdf
Null-safe numbers: hook up static typing rules for method calls.
...
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I0fc4d5b65d3c9494fc280b5af53d0cc065459be8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158481
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-25 02:54:18 +00:00
Konstantin Shcheglov
8053110035
Report ParserErrorCode.MISSING_ASSIGNABLE_SELECTOR for 'super!'.
...
Partial implementation to unblock:
https://dart-review.googlesource.com/c/sdk/+/159966 , to unlock:
https://dart-review.googlesource.com/c/sdk/+/159960
Bug: https://github.com/dart-lang/sdk/issues/43168
Change-Id: I5e3891f4ddf15c747568b38b794d75fcbd30c03a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159971
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-25 00:43:37 +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
Paul Berry
08dd4b1faa
Null-safe numbers: implement static typing rules, hook up for binary operators.
...
Future CLs will hook up the static typing rules for method calls
(`clamp` and `remainder`) and will implement the rules for contexts.
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: Iccfb1fa1ac9aff6c0832d65e4835b5b9bd51a804
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-24 15:34:33 +00:00
Konstantin Shcheglov
e868d3076c
Issue 43151. Fix crash when a field shadows a super-interface method.
...
Bug: https://github.com/dart-lang/sdk/issues/43151
Change-Id: I27e78815007e12edfefc81b5e49eed30bb633229
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159740
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-24 14:29:24 +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
Konstantin Shcheglov
afd6344e99
Add write tests, fix write_error_test.dart
...
Bug: https://github.com/dart-lang/sdk/issues/43100
Change-Id: Ib01192e73905ae1c431491e89e269fd25c6cd9cf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159680
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-22 00:24:31 +00:00
Konstantin Shcheglov
63640ea23d
Remove ElementFactory.functionElementXyz()
...
R=brianwilkerson@google.com
Change-Id: I2dc598481d49d83aa0f7994a455af963fe99b5b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159649
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-21 22:24:31 +00:00
Konstantin Shcheglov
6fb1e57f3a
Move _hasSetter and typeInferenceError.
...
R=brianwilkerson@google.com
Change-Id: I8bf476dd6323f01d987c7cf2c3378f6beb37c267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159647
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-21 21:17:10 +00:00
Konstantin Shcheglov
c2bc119c21
Issue 43144. Convert the bound of type parameter to legacy if necessary.
...
Bug: https://github.com/dart-lang/sdk/issues/43144
Change-Id: I2bf50c498d7919460133d1bed07ce2de861fce08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159646
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-21 20:18:10 +00:00
Konstantin Shcheglov
085076337b
Add LocalVariableElement/PropertyInducingElement.hasInitializer, ParameterElement.hasDefaultValue, deprecate VariableElement.initializer
...
Change-Id: I02ba37b4f6f1ce79ffddf40613646b99ecbedc9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159582
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-21 18:20:30 +00:00
Konstantin Shcheglov
62bd19cac9
Extract VariableDeclarationResolver.
...
Change-Id: Ib88682ae56b3e1dd9717957d6f01571de5a685a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-21 02:05:47 +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
514094b74b
Resolver annotations for each node directly.
...
Specifically, don't rely on climbing up from VariableDeclaration(s).
R=brianwilkerson@google.com
Change-Id: I70225ce0b55f9ee2b3405e8a678cc2c854b2af6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159561
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-20 21:23:39 +00:00
Konstantin Shcheglov
1c0a64ded5
Comments and renames in FlowAnalysisDataForTesting.
...
R=brianwilkerson@google.com
Change-Id: I75710e11b88bbed59e57bc1928f9e06bbd279c5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159520
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-20 17:14:29 +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
Konstantin Shcheglov
32ae7d9efc
Switch tests for the new testing and remove ResolverTestCase.
...
R=brianwilkerson@google.com
Change-Id: I2bbf8a5194878389bca43d534bbf3bc116c5acbf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-19 21:54:47 +00:00
Paul Berry
66501778e7
Run MethodInvocationResolutionTest cases in null safety mode.
...
Previously, MethodInvocationResolutionTest contained a bunch of useful
tests that should pass in both legacy and null-safety modes (with some
minor changes to expectations), but they were only run in legacy mode
(and a very small set of tests were run in null-safety mode). This CL
moves those tests to a mixin so that they get run in both modes.
This is necessary because in follow-up CLs I will be changing the type
analysis rules for method invocations in null safety mode (in
accordance with
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/number-operation-typing.md ),
and I want to make sure not to lose test coverage.
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I263d8422bc2d110dcc7954c7521bd084b7ea839e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-19 19:56:37 +00:00
Konstantin Shcheglov
2b7fc8f134
Update FeatureSet to the new rules.
...
Bug: https://github.com/dart-lang/sdk/issues/43032
Change-Id: I6c7d7dc56fd0d4edcc3c6f6cc6fb0422316b8f4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159187
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-19 18:27:37 +00:00
Konstantin Shcheglov
1c5a17b212
Don't refresh files when they are not notified as changed.
...
The refresh was causing "Cycle loading state error", so it is possible
that this CL will fix this long standing issue.
Bug: https://github.com/dart-lang/sdk/issues/43073
Change-Id: Id1eeacd01cf10e918b002d227c8942e38bed543c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159140
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-18 21:15:00 +00:00
Konstantin Shcheglov
a51f1747e0
Prepare to publish analyzer 0.40.0 and _fe_analyzer_shared 8.0.0.
...
Change-Id: I126207dcc47885565a3a6d7002ff15ad3cc493c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-18 15:12:10 +00:00
Paul Berry
314dc8de98
Run AssignmentDriverResolutionTest cases in null safety mode.
...
Previously, these tests ran only in legacy mode. This CL moves the
tests to a mixin so that they can be run in both modes.
This is necessary because in follow-up CLs I will be changing the type
analysis rules for binary expressions in null safety mode (in
accordance with
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/number-operation-typing.md ),
and I want to make sure not to lose test coverage.
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I44a443205e9b36c698b7c736b75f8701aed7f947
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158600
Commit-Queue: Paul Berry <paulberry@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-17 16:08:39 +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
Konstantin Shcheglov
d9ce879bc2
Track if location has access to this.
...
We will need this also to implement '16.35 Lexical Lookup' from the spec.
Change-Id: I3b77c4a016fd54771b07957d522074aeb8dd1938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158802
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-17 01:08:52 +00:00
Konstantin Shcheglov
87027c97a1
Start rewriting AssignmentExpression resolution, local variables.
...
Also updates for tests when the left side is a SimpleIdentifier.
Change-Id: I8da1392e2aa8e11a323e09aa380fb49e8cbf38da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158522
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-15 01:09:00 +00:00
Paul Berry
8d12c07cce
Work around redundant hint with unnecessary null comparison.
...
This should fix analyzer bot failures triggered by
https://dart-review.googlesource.com/c/sdk/+/155926 .
Bug: https://github.com/dart-lang/sdk/issues/43051
Change-Id: Ie4650a72611c63798054b4f4aad9dfa7d76ad0af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158486
Auto-Submit: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
2020-08-14 17:53:38 +00:00
Paul Berry
27b6e1eaf6
Run BinaryExpressionResolutionTest cases in null safety mode.
...
Previously, BinaryExpressionResolutionTest contained a bunch of useful
tests that should pass in both legacy and null-safety modes, but they
were only run in legacy mode (and a very small set of tests were run
in null-safety mode). This CL moves those tests to a mixin so that
they get run in both modes.
This is necessary because in follow-up CLs I will be changing the type
analysis rules for binary expressions in null safety mode (in
accordance with
https://github.com/dart-lang/language/blob/master/accepted/future-releases/nnbd/number-operation-typing.md ),
and I want to make sure not to lose test coverage.
Bug: https://github.com/dart-lang/sdk/issues/42629
Change-Id: I3eac5fd563d7505abe2930835b14867bebec3512
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158482
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Commit-Queue: Paul Berry <paulberry@google.com >
2020-08-14 17:47:16 +00:00
Paul Berry
e403e6ae77
Flow analysis: rework handling of equality tests.
...
The new logic classifies the LHS and RHS of the equality check as
either null, non-nullable, or potentially nullable, and then either
promotes, treats the expression as equivalent to a boolean, or does
nothing, as appropriate.
This means, for example, that a comparison between a non-nullable
value and `null` is now known to evaluate to `true` for reachability
analysis.
Note: as part of this change, it was tempting to trigger promotion
whenever a varialbe is equality compared to an expression of type
`Null`, but this would be unsound (consider `(int? x) => x == (x =
null) ? true : x.isEven`). So we still only promote when the variable
is compared to a literal `null`.
Fixes #41985 .
There's a corresponding spec change out for review:
https://github.com/dart-lang/language/pull/1134
Change-Id: Id7f1d4eaa3b0fa57124445bb8352eef32c304feb
Bug: https://github.com/dart-lang/sdk/issues/41985
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/155926
Reviewed-by: Konstantin Shcheglov <scheglov@google.com >
Reviewed-by: Johnni Winther <johnniwinther@google.com >
2020-08-14 12:16:36 +00:00
Konstantin Shcheglov
2790ce297d
Update assertSimpleIdentifier() to accept separate 'readElement' and 'writeElement'.
...
Not yet fully enforced, and probably not fully implemented currently.
R=brianwilkerson@google.com
Change-Id: Ibbb43506cf7abb4104d348077e2d5bafeb60ba0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158504
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
2020-08-13 21:09:12 +00:00
Konstantin Shcheglov
302ad7ab2c
Replace isNonNullableByDefaultInternal flag in LibraryElementImpl with FeatureSet.
...
R=brianwilkerson@google.com , paulberry@google.com
Change-Id: I4fdb464df5f70ae93ccff5f06d8c99d34d3f8e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/158500
Reviewed-by: Paul Berry <paulberry@google.com >
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com >
Commit-Queue: Konstantin Shcheglov <scheglov@google.com >
2020-08-13 17:27:04 +00:00