Commit Graph

7883 Commits

Author SHA1 Message Date
Samuel Rawlins 5050f31b29 Revert "analyzer: Mark implicit-casts and implicit-dynamic as deprecated"
This reverts commit 6a54fdd46e.

Reason for revert: broke flutter-analyze

Original change's description:
> analyzer: Mark implicit-casts and implicit-dynamic as deprecated
>
> Also add a fix which replaces 'implicit-casts' with 'strict-casts' and
> a fix which replaces 'implicit-dynamic' with 'strict-raw-types'.
>
> Fixes https://github.com/dart-lang/sdk/issues/47902
>
> Change-Id: I293c3c1fd671ac85c12f9c050465b4d77632f241
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224800
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Samuel Rawlins <srawlins@google.com>

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

Change-Id: Ib2e9492716d3ff6da4fa4e1c64fd658451b16d88
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/239008
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-27 16:56:01 +00:00
Paul Berry 83bea5cfbb Do an extra round of type inference before resolving deferred closures.
The order of operations for type inference of a generic invocation is
now:

1. Create some constraints on type parameters by trying to match the
   return type of the invocation target as a subtype of the incoming
   type context.  (For a constructor invocation, the return type of
   the invocation target is considered the raw uninstantiated type of
   the class enclosing the constructor declaration.)

2. Downwards inference: partially solve the set of type constraints
   accumulated in step 1, to produce a preliminary mapping of type
   parameters to type schemas.

3. Recursively infer all arguments to the invocation, except that if
   experimental feature `inference-update-1` is enabled, skip any
   arguments that are function literals (a.k.a. "closures").  Obtain
   the type contexts for the recursive inference by substituting the
   preliminary mapping (from step 2) into the corresponding parameter
   types of the invocation target.  For each argument that is
   recursively inferred, create additional constraints on type
   parameters using the resulting static type.

4. If no arguments were skipped during step 3, go to step 7 (this
   always happens if `inference-update-1` is disabled).

5. Horizontal inference: partially solve the set of type constraints
   accumulated so far, to produce an updated preliminary mapping of
   type parameters to type schemas.

6. Recursively infer all of the invocation arguments that were
   previously skipped.  As in step 3, obtain the type contexts for the
   recursive inference by substituting the preliminary mapping (this
   time from step 5) into the corresponding parameter types of the
   invocation target.  Again, for each argument that is recursively
   inferred, create additional constraints on type parameters using
   the resulting static type.

7. Upwards inference: solve the set of type constraints accumulated so
   far, to produce a final mapping of type parameters to types.  Check
   that each type is a subtype of the bound of its corresponding type
   parameter.

8. Check that the static type of each argument is assignable to the
   type obtained by substituting the final mapping (from step 7) into
   the corresponding parameter type of the invocation target.

9. Finally, obtain the static type of the invocation by substituting
   the final mapping (from step 7) into the return type of the
   invocation target.

This addresses simpler cases of
https://github.com/dart-lang/language/issues/731.  Note that if
experimental flag `inference-update-1` is disabled, the behavior is
unchanged.

Note that steps 2 and 5 use the same algorithm as each other (they
only differ in how many type constraints have been accumulated so
far), so I've renamed the function that performs it from
`downwardsInfer` to `partialInfer`.

Change-Id: I10d3288d4f4ba9e2b6bc18409186ddc67ca2ee9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238881
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-03-25 22:07:50 +00:00
Paul Berry 5c0e0922d0 Defer analysis of closure arguments when inference-update-1 is enabled.
In order to address https://github.com/dart-lang/language/issues/731
(improved type inference for `fold` etc.) we're going to need to
sometimes defer analysis of invocation arguments that are closures, so
that closure parameters can have their types inferred based on other
parameters.  To avoid annoying the user with inconsistent behaviors,
we defer analysis of closures in all circumstances, even if it's not
necessary to do so for type inference purposes.

This has a minor user-visible effect: if an invocation contains some
closures and some non-closures, any demotions that happen due to write
captures in the closures are postponed until the end of the
invocation; this means that the write-captured variables remain
promoted for other invocation arguments, even if those arguments
appear after the closure.  This is safe because there is no way for
the closure to be called until after all of the other invocation
arguments are evaluated.  See the language tests in this CL for
details.

Note that this change only has an effect when the experimental feature
`inference-update-1` is enabled.

Change-Id: I283fc5eb07af2aeca0a06d523011d8c4617fbad7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237720
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-03-25 16:40:10 +00:00
Sam Rawlins 6a54fdd46e analyzer: Mark implicit-casts and implicit-dynamic as deprecated
Also add a fix which replaces 'implicit-casts' with 'strict-casts' and
a fix which replaces 'implicit-dynamic' with 'strict-raw-types'.

Fixes https://github.com/dart-lang/sdk/issues/47902

Change-Id: I293c3c1fd671ac85c12f9c050465b4d77632f241
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/224800
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-25 14:58:50 +00:00
Brian Wilkerson 61954676ea Add code style options for code generation
Change-Id: Ibc5087aeb88965488502cca74923df6d7a2b185e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238761
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-25 04:47:31 +00:00
Konstantin Shcheglov 143fe67673 Make fields in CompilationUnitElementImpl final and/or non-nullable.
Change-Id: I604ad776196fa90bccf2ba06fa282fa0e7979d18
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238740
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-25 01:20:19 +00:00
Brian Wilkerson 7be81a875a Move AnalysisOptions out of src
In the process, I removed 'useFastaParser' from both the public API and
the implementation class. I also removed 'enableTiming' from the public
API.

The other getters were left because they seem like reasonable options
for plugins to want to query. If you disagree, we can address them in a
future CL.

Change-Id: Ia5630b71190dd68bcd66199baa0c05846fcc37b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238661
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-24 20:43:19 +00:00
Ahmed Ashour 539e14296d FINAL_NOT_INITIALIZED_CONSTRUCTOR not to be reported for static fields.
Fixes #48180

Change-Id: I3c296fb6e307b5dd6cf0dd53cbc7297a88146e81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238358
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-24 19:12:21 +00:00
Konstantin Shcheglov e773e6e713 Issue 48546. Copy the same ElementAnnotation instances for multiple local variables.
Bug: https://github.com/dart-lang/sdk/issues/48546
Change-Id: Ib03c66a38e15dfc537ba992b2f636a32cfa24330
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238464
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-24 04:49:01 +00:00
Sam Rawlins 434e1b70e8 Add many cases for valid @useResult uses
All of the changes here should be non-breaking; they should only result
in _fewer_ diagnostics.

New cases of "check the parent": parent is
* BinaryExpression
* ForElement
* IfElement
* IndexedExpression
* PostfixExpression
* SpreadElement

New cases of a "real use": parent is
* AssertInitializer
* AssertStatement
* ConstructorFieldInitializer
* ForEachParts
* ForEachPartsWithDeclaration
* ForLoopParts
* IfStatement
* ThrowExpression
* WhileStatement
* YieldStatement

Bug: https://github.com/dart-lang/sdk/issues/47685
Change-Id: Ib3fa216d45d01a728f73795b32b52f204eb140e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238264
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-23 22:54:01 +00:00
Konstantin Shcheglov b14c3c3607 Add async methods for Cider.
Change-Id: I8e7ad68af11933748e40899789169fdcf58124e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238003
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-22 00:26:57 +00:00
Konstantin Shcheglov 3d69c3c0c4 Restore sync file methods in AnalysisSession.
There are clients, like `built_value` that cannot be updated.

Change-Id: I27371018039f22cd7ca2cb82b30ec33469aa6e4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/238002
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-21 23:27:57 +00:00
Konstantin Shcheglov 27f5f486f6 Make link() async, propagate async.
Change-Id: Ie74c8acdf2641e834d41e56200f33075e6987236
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237928
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-21 22:11:57 +00:00
Sam Rawlins ab22a8dd8c Avoid single cascades, unnecessary interpolations, and exposing private types
* Make `MicroContextObjects` constructor private, which is not used
  outside the library.
* Remove unused `analysisContext2` constructor parameter.
* Make `tryMatchSubtypeOf` private, which requires a parameter of
  private type.
* Make `_FileStateFiles` public, as it is used outside the library.
* Return empty for void-typed functions.

Change-Id: If67a69effdbbaed2eb364788e52eeb60270a0c19
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237855
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-21 18:12:47 +00:00
Konstantin Shcheglov b4d339f9d6 Revert "Run macro types phase."
This reverts commit eb95543629.


Revert "Add the macro unit into 'units' of LibraryBuilder."

This reverts commit 2670218aea.

Change-Id: I7d4964264b8be92cfa98334fde0579eeb989c94b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-21 17:24:19 +00:00
Konstantin Shcheglov 2670218aea Add the macro unit into 'units' of LibraryBuilder.
So, we should resolve references, types in it.
Not tested yet.

Change-Id: I5264d9b9b8dbb6e05188a2dad961fcd7b87cfc98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237841
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-18 23:17:42 +00:00
Sam Rawlins 843a31fe45 Prefer string interpolations; other small fixes for lints 2.0.0
Change-Id: Ie66c42ac738adbcf07d0b7c5ccc77e34975008c2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237801
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-18 22:13:21 +00:00
Konstantin Shcheglov eb95543629 Run macro types phase.
The very first version, many improvements to be done later.

Change-Id: If78efba1ab0d06aaea6f3c7525fcd00a39c18459
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237768
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-18 20:22:41 +00:00
Sam Rawlins d5cc53a1b8 Prefer for-loop over forEach; other little fixes
These linter fixes help prepare analyzer for lints 2.0.0

Change-Id: Ic942fa367965edac479b917cbbb601b30da8b53c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237766
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2022-03-18 03:37:47 +00:00
Konstantin Shcheglov e253d467ae Fix for reporting UNUSED_ELEMENT_PARAMETER when used via super-formal.
Change-Id: I334b2b30dd29ae61fb7fbf3bf2af8e68cf969a3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237767
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-18 02:14:38 +00:00
Brian Wilkerson ef00a01289 Remove an unused parameter from one of the test classes
Change-Id: I66b66816c8fec84bfdec6eafc8ce17f71361b879
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237743
Auto-Submit: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-17 22:24:37 +00:00
Konstantin Shcheglov 073db61a4e Add implicit arguments for super-formal parameters during constant evaluation.
Change-Id: I1150ebfc9bcdad53ffb38504cff97c2ea9aea5cb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237721
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-17 17:39:16 +00:00
Jens Johansen fd4e41a7af [parser-ish] Better errors on invalid unicode escapes
https://github.com/dart-lang/sdk/issues/48542

Change-Id: Icbdcc939a93c737914091c00aaefa3c4efb2dde0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2022-03-17 13:57:45 +00:00
Konstantin Shcheglov 963bd7c165 Add AnalysisContext.changeFile()
Change-Id: I42d215e872322cace019bc64f04a74d883e9849e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237628
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-17 00:33:34 +00:00
Konstantin Shcheglov 5bd060484b Fix order of inference for super-formal parameters.
Change-Id: Ie98663d1788b14d4622e692b446756d8c1c9b763
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237629
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2022-03-16 20:31:04 +00:00
Konstantin Shcheglov eea52d35f8 Issue 48583. Inherit evaluationResult in DefaultSuperFormalParameterElementImpl.
Bug: https://github.com/dart-lang/sdk/issues/48583
Change-Id: I6217adb5d1e96d2fbb40e4033b9ed62025cd60ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237622
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-16 18:14:14 +00:00
Konstantin Shcheglov 1a1701c2b5 Build macro kernels.
They are not used yet.

Change-Id: I7849bf845f161f5c48e8ec9ded5900a3486148c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237483
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-16 16:55:14 +00:00
Konstantin Shcheglov c4752d7f20 Include null suffix in Cider error verifier diagnostics.
Bug: https://buganizer.corp.google.com/issues/223932544
Change-Id: I860ee8b85a9ff6505df988df2ab50fe025d4a95e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237402
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-15 16:49:27 +00:00
Konstantin Shcheglov 111101039b Don't create default constructors for mixins.
Mixins are not classes, they cannot be instantiated.

Change-Id: Ib91b53046fead331886e4099625371016c4b2ba8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237240
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-15 15:48:21 +00:00
Konstantin Shcheglov 6e1f4a7642 Enable null safety by default in Cider tests.
Change-Id: If9839eaed89adeb26bb4249e6e0fe9dda0ce22e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-15 15:14:39 +00:00
Konstantin Shcheglov 935faa6c8a Return potentially affected files from applyPendingFileChanges()
Change-Id: I7a9410a5ba8a2cdbc2fd44fb5e25c311569696ab
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-15 00:32:49 +00:00
Konstantin Shcheglov 189cf35a96 Add ClassElementImpl.isMacro
Change-Id: Icf59c2e701c2008759f863c97fff22088abc1e54
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 20:45:49 +00:00
Konstantin Shcheglov 41b3e0abcc Make 'content' required in ResourceProviderMixin.newFile()
Change-Id: Id697b0736b95a913c31247a66425027852f1ddc5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 17:31:48 +00:00
Paul Berry 7642021418 Verify invariant of TypeConstraintGatherer.trySubtypeMatch.
Documentation comments claim that if the match fails, the set of type
constraints is unchanged.  From code inspection, I believe this is
correct, but it's non-trivial to verify, so I've added a line to
type_constraint_gatherer_test.dart to double check it.

Change-Id: I9587922ca90fe9bbd51217906a4f4bd76047c777
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/237002
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-03-14 16:42:15 +00:00
Konstantin Shcheglov b66e349926 Extract AbstractElementsTest, simplify a bit.
Change-Id: I56646688729a326573f9dc56455c694097fd7d93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236921
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-14 16:10:28 +00:00
Paul Berry 1ffba32609 Rework type inference logic to avoid redundant constraint gathering.
Previously, the analyzer would perform downwards and upwards inference
using separate GenericInferrer objects.  This meant that any
constraint gathering work performed during downwards inference had to
be repeated during upwards inference.

This change avoids the extra work by using a single GenericInferrer
object for both downwards and upwards inference.  It also cleans up
the API for GenericInferrer a bit.

Change-Id: Idc5deed96c18ffc89aeb8ba4e5e95942843dae11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236660
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-03-14 15:05:18 +00:00
Konstantin Shcheglov 8fc70b1907 Fix augment/macro keyword mixup, tests.
Change-Id: Id9a60f263af9dec4f7e0eacbb1a9b2ae98b77afb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236761
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 22:16:17 +00:00
Konstantin Shcheglov c60cb96251 Run AbstractResynthesizeTest in package:test
Change-Id: I90c1e55bfccc94dcc12ed4ae310faa22c1a22da1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236763
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 22:15:35 +00:00
Konstantin Shcheglov 13c0a4c2c0 Enable 'macros' experiment in tests.
Change-Id: Ib5593b12f13c23cc9a703d80cf50bbec5608e53f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236702
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-03-10 20:08:21 +00:00
Konstantin Shcheglov 5a31381f8e Update VarianceTest to use AST dump.
Change-Id: Id06b96b2d0be1e0772c86f09e6f03fc8c5736a9a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 19:54:56 +00:00
Konstantin Shcheglov f8a42a28de Remove CodeLinesProvider from ResolvedAstPrinter.
We don't use this feature.

Change-Id: Ic6779554754a5f83fedb7b5973f27d57fb49b72d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236700
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 19:04:45 +00:00
Konstantin Shcheglov 582bc7e8b0 Replace assertInstanceCreation() with AST dump.
Change-Id: If712679b67cef90c238bd55203547f3344cd0526
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236620
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 18:15:55 +00:00
Paul Berry 76bbd199a4 Fix analyzer implementation of the "variance" feature.
It had bit rotted slightly: we were not properly accounting for
variance when gathering type inference constraints from the comparison
of two interface types.

Also, some of the tests needed to be updated to account for follow-on
errors.

Change-Id: Ife9feae3e2180a179ebc8503751690789dc1483e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235941
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2022-03-10 15:56:35 +00:00
Konstantin Shcheglov 1a3eefd699 Stop using newDotPackagesFile() in analyzer/.
Change-Id: I3a150895e4aa8822317bb1a9225033c787b4ecd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236445
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 05:27:45 +00:00
Konstantin Shcheglov fc2ebe7310 Use the same writeType() for elements as for AST.
Change-Id: Ia29e9c86cbb34d0a92c76ca390927c1ca6661d34
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236443
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 01:32:16 +00:00
Danny Tuppeny 0de43ae5f7 [analysis_server] Make CompilationUnitElement.lineInfo non-nullable
Change-Id: Ia42e2a2fd153b5af167588b9d4d473d1f998a67b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-10 00:19:15 +00:00
Konstantin Shcheglov c13e95d6dc Use explicit library for summary export tests.
Change-Id: I9dc09a05937d7c347648c04faa38a06d343a83a8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236420
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2022-03-09 23:45:25 +00:00
Konstantin Shcheglov f9ed80f7a5 Include DartType.alias into AST dump.
Change-Id: I7b4d7351ac219edce0c89b45220a52f37e6dce6d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236360
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2022-03-09 22:26:34 +00:00
pq c3e42e71bb add mock unawaited
Change-Id: I3df9342779f95a2e160b56613ab3f31068694a0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2022-03-09 21:41:34 +00:00
Konstantin Shcheglov 4ffb83acaf Get non-nullable DartType in _typeStr().
Change-Id: I40a5ed56079a6c3908c1a7cdf7cd796015660eef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/236303
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2022-03-09 20:26:05 +00:00