Commit Graph

10502 Commits

Author SHA1 Message Date
Konstantin Shcheglov 01154855d1 Make control-flow-collections, set-literals, spread-collections available since 2.0.0
See https://github.com/dart-lang/language/issues/286#issuecomment-503614115
and https://github.com/dart-lang/sdk/issues/43462

Change-Id: Ib8c37a2b5e3ce6c737e496bf285d946baf3a41d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-19 16:12:07 +00:00
Sam Rawlins 51840c501a Analyzer: add two checks for the @internal annotation.
The meta package does not yet have an `internal` constant;
this CL just adds one to the mock packages for testing.

Two checks are implemented:

* Hint if an @internal annotation is found on an element which is
  already part of a package's public API (based on file path).
* Hint if an element annotated with @internal is exported from a
  package's public API.

The notion of "public API" is also implemented for each type of Package:
BasicPackage, BazelPackage, GnPackage, PackageBuildPackage,
and PubPackage.

Bug: https://github.com/dart-lang/sdk/issues/28066
Change-Id: Ifc2709028afcd241f59e802f5952539f717704c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163126
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-18 23:04:06 +00:00
Konstantin Shcheglov f3acf0caab Move nonNullifyLegac() to TypeSystemImpl.
Change-Id: I057447c029cdaf89f497e42e2a8521c777c92ad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163481
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-18 22:36:36 +00:00
Konstantin Shcheglov 524f739e0b Make using shared ByteStore optional.
I plan to set the flag to `true` locally, but git-ignore the file, so
avoid uploading it for review as I did several times.

Change-Id: Ic7fe4666b0a59fdc662d43baaf7cd2cba9f05005
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163480
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-18 22:26:16 +00:00
Brian Wilkerson e20a5d171c Add a utility to make it easier for lint rules to check whether a feature is enabled
Change-Id: I304286df6bad6ea4c56bd77309e677c3a7170e5b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163440
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-18 19:30:46 +00:00
Konstantin Shcheglov ffe53f03f9 Remove TypeSystem / TypeProvider from ConstantEvaluationEngine.
We always need to use the properties of the library.
So, these "default" values are not usable.

Change-Id: I94c63d28900186a7f0e0733717612683aaed122f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-18 18:44:36 +00:00
Konstantin Shcheglov 77bf324887 Fix a test for Windows.
Change-Id: Id35d9c87f8922411461b718c9e3d3babc799416e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163400
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-18 16:36:06 +00:00
Konstantin Shcheglov aab7e93b15 Preserve element and typeArguments of FunctionType during legacy erasure.
Change-Id: I02670f86773ed65b0943c9a28fd03e89da2208ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163301
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-18 00:04:41 +00:00
Konstantin Shcheglov cefa35962d Issue 43465. Break infinite recursion that might happen with file system links.
Bug: https://github.com/dart-lang/sdk/issues/43465
Change-Id: I1f5f17af019345ba361a507263fdfea7cb9b0952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-17 23:53:51 +00:00
Nate Bosch 19e497ca05 Fix typo librarys -> libraries
Change-Id: I28c686193fa0385257645439f9d898d8661f67a4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163300
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>
2020-09-17 23:25:21 +00:00
Konstantin Shcheglov 044d3d5e22 Add MemoryResourceProvider.newLink()
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/43465
Change-Id: I56a33413cc297b1c362b92b60999e3b506d5e139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163264
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-17 22:40:01 +00:00
Konstantin Shcheglov 5051d75bc6 Issue 43462. Compute constant values in libraries with contain them.
R=brianwilkerson@google.com

Bug: https://github.com/dart-lang/sdk/issues/43462
Change-Id: I82200c06b1a77f634b7c7f30fd3ad7e10eb01ad4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163280
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-17 21:26:13 +00:00
Konstantin Shcheglov b820083ed9 Issue 43439. Identify invalid URIs with double '/' or '.' in BazelPackageUriResolver.
Bug: https://github.com/dart-lang/sdk/issues/43439
Change-Id: Ifc7f24ff0e4938d85ddd225fbf576d3a60cc608c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163134
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-17 21:09:43 +00:00
Sam Rawlins f28fb78e8f Analyzer: Use 3 upcoming pedandic lints
Change-Id: I7bd1d856024feee5c4e3ab346a46db059b692b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163160
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-17 16:20:42 +00:00
Paul Berry 53e707f26d Flow analysis: don't consider a foreach-declared variable to be written to.
When performing flow analysis for a "for each" loop such as `for (var
x in ...) { ... }`, we don't need to consider the iterated value to be
"written to" the variable `x`, since the actual runtime semantics are
to create a fresh instance of the variable `x` each time through the
loop, initialized to the iterated value.

Fixes #43136.

Bug: https://github.com/dart-lang/sdk/issues/43136
Change-Id: I497c408c3efc26e93502de8ba0530bb5278e74c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-09-16 19:07:58 +00:00
Paul Berry 0eec9ee53c Use promoted type to infer for-each iterables.
Fixes #42653.

Change-Id: I90319b775207e6cc1c6b7a79d29b2c237b750845
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162625
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-09-16 18:20:48 +00:00
Konstantin Shcheglov 4b30c91266 Resolve PrefixedIdentifier in AssignmentExpressionResolver.
R=brianwilkerson@google.com

Change-Id: I4239dba7f6f6255e0db501a7588ca3a51ee18416
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163003
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-16 16:17:38 +00:00
David Morgan 8d8df2c9f6 Revert "Issue 43162. Change matching dynamic/void vs. 'T?'."
This reverts commit 7b0aeb2ac8.

Reason for revert: regressions in analysis in legacy mode, see b/168675476

Original change's description:
> Issue 43162. Change matching dynamic/void vs. 'T?'.
> 
> Bug: https://github.com/dart-lang/sdk/issues/43162
> Change-Id: I8ae2166e4bc593b42ddd39c35e7d02a706d7b94d
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162621
> Reviewed-by: Leaf Petersen <leafp@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: I288f8ccf82c17565c40e02245998590ebd7c98bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/43162
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162747
Reviewed-by: David Morgan <davidmorgan@google.com>
Commit-Queue: David Morgan <davidmorgan@google.com>
2020-09-16 07:36:05 +00:00
Konstantin Shcheglov 7b0aeb2ac8 Issue 43162. Change matching dynamic/void vs. 'T?'.
Bug: https://github.com/dart-lang/sdk/issues/43162
Change-Id: I8ae2166e4bc593b42ddd39c35e7d02a706d7b94d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162621
Reviewed-by: Leaf Petersen <leafp@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-16 02:31:02 +00:00
Konstantin Shcheglov f7d1c55a19 Resolve 'call' on FunctionType(s), and Never in TypePropertyResolver.
Change-Id: I357e3704ab48378d4f4f87dbc41148193c23d592
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-15 21:32:02 +00:00
Konstantin Shcheglov 54e89a5c82 Resolve '[]' and '[]=' as other InterfaceType members.
Change-Id: I60372b17f383854a108831a0bfe2a85fadb306fd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162940
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-15 17:04:11 +00:00
Konstantin Shcheglov 744e34aec0 Support type parameters in ReplaceTopBottomVisitor.
See https://github.com/dart-lang/language/pull/1133

Change-Id: I3800b88496a8bf214b4bc366f4cb7ef3e9968f17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162784
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-15 04:39:31 +00:00
Konstantin Shcheglov c20d17b18f Change TypePropertyResolver and ResolutionResult to specify if an error should be reported.
Change-Id: I4fd76b605acfb12488cfedd2571b1af964fdbd25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162840
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-15 04:36:41 +00:00
pq 62abba754b validate returns of @doNotStore
See: https://github.com/dart-lang/sdk/issues/42497

Change-Id: I86516a19eb7a6560f95ea888ab1384208da222f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162821
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-14 23:59:08 +00:00
Konstantin Shcheglov a08054586c Report errors on the compound assignment operator, not the left expression.
Change-Id: Icc53a35082cdbbb05db3f009eb9d6b743ef9e7a7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162782
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-14 18:19:09 +00:00
Konstantin Shcheglov 75fe96d8f2 Don't look for properties in FunctionType in TypePropertyResolver.
Change-Id: I493c9af62bb6ed3de90e46d0391698c009058d52
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-14 15:44:29 +00:00
Konstantin Shcheglov 410dbc2bf8 Show only methods to resolve PrefixedIdentifier and PropertyAccess from PropertyElementResolver.
Change-Id: I62fd83fefb1b5c0d8deda367288d561a9844937d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162630
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-14 15:36:25 +00:00
Konstantin Shcheglov 9fffe7e4df Simplify resolution of operator element in AssignmentExpressionResolver.
Change-Id: I51a9dc087ef70dade5d1db8714e934565d760952
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162662
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-14 15:36:24 +00:00
Jens Johansen e6ffc0b285 [parser] Issue different warnings for missing identifier based on whether the token is used or not.
E.g. "var = 42;" now has a different error message than "var default = 42;".

Fixes #22553

Change-Id: I58affe988569d8e79190b63f7267b471a1b0ebc8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162182
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-14 08:55:18 +00:00
Konstantin Shcheglov ba78db411a Remove DartSdk.analysisContext
Change-Id: I6a67344d928e6182a851741bbbc862284af710c0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162623
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-13 00:56:36 +00:00
Konstantin Shcheglov ce6a95c15d Revert accidentally landed shared ByteStore.
We decided not to land this, but I change it locally to test faster,
and forgot to revert with one of the CLs.

Change-Id: I4817c768778c0bb10fc0030fb5885bac8fbe2ce4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-13 00:56:18 +00:00
Konstantin Shcheglov c71ce5234d Remove DartSdk.analysisOptions getter/setter.
Change-Id: I6bdcd1d8c2e998bf4adbf26ddf533f5d649c73c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162620
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 21:33:26 +00:00
Konstantin Shcheglov 0567babb06 Include packageLanguageVersion into the linked signature.
It is exposed from LibraryElement.

Change-Id: I6acf704312e185ff8fd8b6391590d5385f9821df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162482
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 17:23:25 +00:00
Konstantin Shcheglov 38156a5a39 Merge TypeSystem2 into TypeSystemImpl.
Change-Id: I66f9032ed12166966e1e9eefe00d1e252ea175e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162385
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 17:21:25 +00:00
Konstantin Shcheglov 44928c7a20 Issue 43397. Fix isDefaultConstructor when view from a legacy library.
Bug: https://github.com/dart-lang/sdk/issues/43397
Change-Id: I1cd4ae4bea441732d1c6ef68a917fcccb144ec62
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162584
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-12 16:28:05 +00:00
Konstantin Shcheglov 54e98b03d7 Fix for inference when AssignmentExpression references a not yet inferred variable.
Change-Id: I61b57429607454d4cfe002fe6588858853a166dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162560
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-11 21:35:25 +00:00
Konstantin Shcheglov ec65869de7 Use assertNoErrorsInCode() instead of the empty list of errors where possible.
R=brianwilkerson@google.com

Change-Id: Iac17fe779fc44dec3319687d80fc97761e7332f5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162481
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-11 20:22:53 +00:00
Konstantin Shcheglov af110a7aa4 Change resolution of assignment to PropertyAccess.
Change-Id: Ie9de1166eb0dfd179d539f1b10c54084caf643d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162248
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-11 15:50:20 +00:00
Konstantin Shcheglov 51f766f5a8 Support for 'dart_package (null_safety = True)' in Cider.
R=brianwilkerson@google.com, keertip@google.com

Change-Id: I840afe2f673651fa941df63255e710d2ccdd1f39
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162360
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-10 21:11:45 +00:00
Sam Rawlins d266dfb1a4 Analyzer: Refactor _PSDependency factory constructor to not return null
Change-Id: I8bab14bacc14c88fc0d0c3276aee1d48be40116a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162101
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-10 19:07:37 +00:00
Jens Johansen b0acaea1e5 [parser] Recover written out binary operators
* Add mechanisms to try out a recovery and only perform it if is
  successful.
* Recover written out binary operators, e.g. "a xor b", "a or b" etc.
  This fixes #26810 and is also how these operators are written in e.g.
  Kotlin. This might be somewhat controversial though.
* Adds a mechanism to _replace_ a token by another token.
  This might be controversial.
  It is done because just inserting the operator causes the same rewrite
  to be attempted on the same token stream several times (at least with
  the way the token stream is parsed via the CFE) in turn causing it to
  be recovered *sometimes*. This is now avoided by actually replacing
  the token.

Change-Id: Icfa806045575d2aa2e5f35126708651b275bcf84
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162003
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2020-09-10 06:23:33 +00:00
Konstantin Shcheglov 6daf283c96 Inline computing type for ??.
Change-Id: Ie71c9653615e67e4ab73a0bda9b41685f0fb84cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162105
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-09 15:50:19 +00:00
Konstantin Shcheglov 1a784f4ebd Remove unnecessary _nonNullable() in AssignmentExpressionResolver.
Change-Id: I0e551966c662c278e4151c53f35c6ba40d88633e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/162123
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-09 15:49:53 +00:00
Jacob MacDonald ca25787ad4 update feature_set_provider to recognize asset uris in the same way as package uris
Bug:b/167264816
Change-Id: I4cdd76a6a81723b5817088b8cf92a54e5c82ee42
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161662
Auto-Submit: Jake Macdonald <jakemac@google.com>
Commit-Queue: Jake Macdonald <jakemac@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-03 16:55:25 +00:00
Konstantin Shcheglov 41fe5e1560 Report ASSIGNMENT_TO_FINAL for top-level variables.
Change-Id: I75aed440d2431e674eb87f230a16655b2ace90c5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161660
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-03 16:37:15 +00:00
Paul Berry 88980bf724 Fix verify_diagnostics_test.dart.
This was broken by a4b2047d9d.

Bug: https://github.com/dart-lang/sdk/issues/43263
Change-Id: Ia9bdec633861172c06b30fbe8260b648f1fee39e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161661
Auto-Submit: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-03 05:15:23 +00:00
Paul Berry a4b2047d9d Reland "Flow analysis changes to fix mixed-mode unsoundness loophole."
This is a reland of d833f2f65c

Original change's description:
> Flow analysis changes to fix mixed-mode unsoundness loophole.
> 
> This is the flow analysis portion of the fix to
> https://github.com/dart-lang/language/issues/1143.  Follow-up changes
> will be needed in the CFE and/or backends to ensure that exceptions
> are thrown under appropriate circumstances.
> 
> This CL also makes some improvements to flow analysis's reachability
> analysis so that it accounts for nullability of the target when
> analyzing the reachability of `??=` and `?.`.  Hopefully these
> improvements should make the fix to
> https://github.com/dart-lang/language/issues/1143 clearer and more
> consistent.
> 
> Change-Id: I5fa5c070f13fd57ac4c2fb87f2d67588861594b0
> Bug: https://github.com/dart-lang/language/issues/1143
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160440
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Johnni Winther <johnniwinther@google.com>
> Commit-Queue: Paul Berry <paulberry@google.com>

Bug: https://github.com/dart-lang/language/issues/1143
Change-Id: If9c45649c1e9f4b19f7c282e7a1c4c956a7bc17f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161622
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2020-09-03 01:01:43 +00:00
Mike Fairhurst 57a877a1a1 [analyzer] Remove dart:async imports from test cases
Change-Id: I804fd909e7c3363e78ecb90a954e17301fa77a2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161470
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-09-02 23:45:12 +00:00
Konstantin Shcheglov 3692695405 Move isInstanceMember to ElementExtension.
R=brianwilkerson@google.com

Change-Id: If077667e97fe00d4ab018f864d9c0992ec94cb9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161445
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-09-02 20:43:22 +00:00
Konstantin Shcheglov 16e63e9b61 Fix constant evaluation when null safe from legacy, super constructor invocation.
Bug: https://buganizer.corp.google.com/issues/167265320
Change-Id: I7de8a0feed8425604d19af5bd6381c94573225a0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/161621
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-09-02 20:22:33 +00:00