Commit Graph

9114 Commits

Author SHA1 Message Date
Paul Berry 65d157b5bb Fix type of receiverTypeObject in AssignmentVerifier.verify.
It was not necessary for this argument to support both `String` and
`DartType`; we can ensure that we always pass in a `DartType` by
calling `ClassElement.thisType`.

Change-Id: I94ac2fed7495b8267edea003d1fd088649c2d4a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217620
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-11-01 15:32:50 +00:00
Sam Rawlins 930697a158 Improve messaging of invalid yield type
Fixes https://github.com/dart-lang/sdk/issues/47379

We use a separate message for yield expressions, so that the yielded
type can be used. In checking against the yielded type, we also stop
reporting in some cases, which removes duplicate errors.

Change-Id: I2ce036086ca06d5ff32531afd4b1812f17b908ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218745
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-11-01 15:28:51 +00:00
Sam Rawlins 243fb5c383 analyzer: Support non-proper rename type alias constructor tear-offs
An alternative to https://dart-review.googlesource.com/c/sdk/+/218582

In the case of a constructor tear-off through a non-proper rename type
alias, we store the type alias on the FunctionState in constant
evaluation.

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

Change-Id: I3bcbc11fceafc3a688eb956cf0459ad1dbde6307
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218746
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-11-01 04:29:01 +00:00
Konstantin Shcheglov 0d74a3e436 A few renames of TypeName to NamedType.
Change-Id: Ie0eae6906457a28665855eb16371ad2230d1104a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218743
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-31 21:51:00 +00:00
Konstantin Shcheglov 56bb1d56e1 Rename AstTestFactory methods that return NamedType.
Change-Id: I2546ca0352b4149509d80ad6dde97b2eb686491b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218741
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-31 19:33:00 +00:00
Konstantin Shcheglov 19661d7f72 Fix errors in mock SDK.
Change-Id: I27263ddbad45881d92a98ec237851dbed37cc4da
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218666
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-29 20:17:50 +00:00
pq aad6da844e respect awaited used results
Fixes: https://github.com/dart-lang/sdk/issues/47569

Change-Id: If5391899603ad6ee4295d1d3a8fabba9a26a958f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218661
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
2021-10-29 18:09:23 +00:00
Sam Rawlins 8f756bf96b Add CommentReferableExpression, for expressions which can be used in a CommentReference
* Replace `identifier` field with `expression`, which means deprecating
  `identifier`, redirecting users to `expression`. For now, `expression`
  always returns an Identifier. In a future breaking release, it will
  return other CommentReferableExpressions.
* SimpleIdentifier, PrefixedIdentifier, PropertyAccess,
  ConstructorReference, FunctionReference, and TypeLiteral are all
  CommentReferableExpressions, but support is not implemented yet to
  parse CommentReferences with those contained expressions.

Bug: https://github.com/dart-lang/sdk/issues/47444
Change-Id: I1905afecf3878cd7dca6e275ef0a2ab80500eb4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216320
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
2021-10-29 16:38:09 +00:00
Sam Rawlins 6d276f9fd6 analyzer: Fix instantiated type parameter in function reference error
This fixes language/const/instantiated_function_constant_test

Change-Id: I06f42480f8a55de1c6d75b2b5845bcefb769fa78
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218540
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-29 05:12:02 +00:00
Johnni Winther 44e35b1daa [cfe] Check for misplaced type arguments on implicit creation expression
Change-Id: Ic3436f2bce0369d0efad9946cbbdae7c6bf334b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218400
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
2021-10-28 19:21:39 +00:00
Sam Rawlins 0da6894247 Implement Generic Function Instantiation via wrapping node
This is a re-land for https://dart-review.googlesource.com/c/sdk/+/217880.

The primary difference is the call-sites of
insertGenericFunctionInstantiation. There are more, and many more test
cases.

This is a non-breaking change (when analyzing code at language version
2.14 and earlier). If constructor-tearoffs is enabled (language version
2.15), then FunctionReference nodes are inserted, to represent generic
function instantiation. Constant evaluation can then use the
`typeArgumentTypes` to instantiate arbitrary function-typed
expressions.

If constructor-tearoffs is not enabled, generic function instantiation
continues to take place at a SimpleIdentifier, PrefixedIdentifier, or
PropertyAccess only, with constant evaluation using
SimpleIdentifier.tearOffTypeArgumentTypes.


Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Icf876cb6866bc1030e0cefaaafe221757d5b5639
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218221
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-10-27 19:25:35 +00:00
Konstantin Shcheglov d7718a934d Issue 47073. Inherit covariant-by-declaration from any candidate.
Initial: https://dart-review.googlesource.com/c/sdk/+/217081
Reverted: https://dart-review.googlesource.com/c/sdk/+/217288

Presubmit:
https://fusion2.corp.google.com/presubmit/tap/405776629/OCL:405776629:BASE:405789171:1635310230957:629680d7

Bug: https://github.com/dart-lang/sdk/issues/47073
Change-Id: I5458d60d0bf5cb88488ebd3fb21b0e45ab4ccfde
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218200
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-27 16:35:58 +00:00
Sam Rawlins db07eef77d analyzer: visit local variables in resolution more safely
I'm preparing for the situation where an expression of (almost) any kind
could be wrapped with a generic function instantiation, and I was very
worried that there were a lot of cases like this:

    var localVariable = node.childNode;
    localVariable.accept(_resolver);
    // Do more with localVariable.

This is dangerous because localVariable may no longer be the same node
as `node.childNode`. I searched eerywhere I could for dangerous cases
like this. In some cases, I follow the middle statement with
`localVariable = node.childNode`, which is a common practice. In other
cases, the local variable was only referenced 2 or 3 times, and was
unnecessary. In other cases, I saw that the node strictly referred to
statements or other types of nodes, like a CatchClause. I am
reassured though that there really wasn't too much code like this.

I'd love to figure out how to enforce this statically, but haven't
found a good solution.

Change-Id: If38124dc2036b6f04879a065d66bf3ea73e68977
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218184
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-27 01:43:21 +00:00
Samuel Rawlins ccf75d6539 Revert "Implement Generic Function Instantiation via wrapping node"
This reverts commit 1c8f56fb13.

Reason for revert: This breaks package:collection at
ListComparableExtensions.binarySearch, at
`comparable ?? compareComparable`:

The argument type 'Function' can't be assigned to the parameter type
'intFunction(E, E)'. #argument_type_not_assignable

Original change's description:
> Implement Generic Function Instantiation via wrapping node
>
> This is a non-breaking change (when analyzing code at language version
> 2.14 and earlier). If constructor-tearoffs is enabled (language version
> 2.15), then FunctionReference nodes are inserted, to represent generic
> function instantiation. Constant evaluation can then use the
> `typeArgumentTypes` to instantiate arbitrary function-typed
> expressions.
>
> If constructor-tearoffs is not enabled, generic function instantiation
> continues to take place at a SimpleIdentifier, PrefixedIdentifier, or
> PropertyAccess only, with constant evaluation using
> SimpleIdentifier.tearOffTypeArgumentTypes.
>
> Bug: https://github.com/dart-lang/sdk/issues/46020
> Change-Id: Ie370c00c8a2ce7a4791ac9cdb7459a01339a79c1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217880
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: Ie76cd703e05cbf65fecaa76b72e829f8272b8307
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: https://github.com/dart-lang/sdk/issues/46020
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218089
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-26 21:05:32 +00:00
Sam Rawlins 0fe438812b analyzer: Correct const is and is! for null safety
Fixes https://github.com/dart-lang/sdk/issues/46081
Change-Id: I59a52a51739974e318ea32f3eb3b39dedbb5a9fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218084
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-26 17:24:31 +00:00
Sam Rawlins 1c8f56fb13 Implement Generic Function Instantiation via wrapping node
This is a non-breaking change (when analyzing code at language version
2.14 and earlier). If constructor-tearoffs is enabled (language version
2.15), then FunctionReference nodes are inserted, to represent generic
function instantiation. Constant evaluation can then use the
`typeArgumentTypes` to instantiate arbitrary function-typed
expressions.

If constructor-tearoffs is not enabled, generic function instantiation
continues to take place at a SimpleIdentifier, PrefixedIdentifier, or
PropertyAccess only, with constant evaluation using
SimpleIdentifier.tearOffTypeArgumentTypes.

Bug: https://github.com/dart-lang/sdk/issues/46020
Change-Id: Ie370c00c8a2ce7a4791ac9cdb7459a01339a79c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217880
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-10-26 16:57:12 +00:00
Sam Rawlins 383f45ac7e Add DEPRECATED_NEW_IN_COMMENT_REFERENCE diagnostic
This is a new HintCode for code in which comment-references is enabled.

`/// See also [new List].` is marked as deprecated, preferring a direct
reference (or "tear-off") of a constructor, like
`/// See also [List.new].`.

Additionally, a new quick fix supports making the above conversion,
taking into account both unnamed and named constructors.

Bug: https://github.com/dart-lang/sdk/issues/47446
Change-Id: Iec68ef21bd03198ea822979f6f0048cc655023c8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217400
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-26 16:52:51 +00:00
Konstantin Shcheglov 626c8c5f84 Extract shared method to create new FileState instance.
Change-Id: I78381cc0b2d542ca1f0dbbac6c2388cf8ae74dc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218081
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-26 15:32:51 +00:00
Konstantin Shcheglov 873005502d Deprecate AnalysisResult.path/uri
Change-Id: I0908a49fd8983dbcbdf585c026190ab0fefb45c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218061
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-25 22:04:39 +00:00
Konstantin Shcheglov 9f00d0c94e Deprecate DriverOptions.mockSdk
Change-Id: I7f28a8ac1fbbc45693b6fe038bf5490440703ccf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/218020
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-25 18:33:51 +00:00
Konstantin Shcheglov 1aa6fa4776 Refactor Cider FileState.
The general direction is to make pieces of data that are produced
together to be stored together, and so be available together.

_FileStateLocation is created before FileState, so it is separated.

Any FileState has some unlinked state, so we pass _FileStateUnlinked
into the constructor. In Cider we don't refresh files, we discard
them and recreate. So, '_unlinked' is a final field.

Practically FileState works as a wrapper around _FileStateUnlinked.
It could probably have been inlined into FileState. My excuse for
not doing this is that in DAS, at least at the moment, we keep
FileState instances and refresh them with replacing their unlinked
states. So, they should be separate objects.

Change-Id: I9439a4021e6efa9e4375eceb5eecf534eabda168
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-25 17:47:59 +00:00
Konstantin Shcheglov b61605b5e6 Remove double.CAPITAL constants.
Presubmit: https://fusion2.corp.google.com/presubmit/tap/404922794/OCL:404922794:BASE:405010232:1634915532338:93e197a/targets

Change-Id: Ib29a079678eced84e6d3a4f322c64a548b3668c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217781
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-23 18:22:33 +00:00
Konstantin Shcheglov 7e71047c08 Make UnitElementResult to implement FileResult.
Change-Id: I853d65e4ac906710891eed5e586cfb2345f57f11
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217802
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-23 17:41:54 +00:00
Konstantin Shcheglov e916841bcc Deprecations and renames for getXyz() in AnalysisDriver.
Presubmit looks green.
https://fusion2.corp.google.com/presubmit/tap/405055453/OCL:405055453:BASE:405057194:1634949541100:f811db8d/targets

Change-Id: I8f7f036003650611760523dd315ba89724a29b0d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217805
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-23 17:15:33 +00:00
Paul Berry ce8ee6cf03 Check the number of arguments when instantiating AnalysisErrors.
Change-Id: I45fa2a560b7368370fae4a7a94d8f52136e92486
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/213821
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-23 14:13:33 +00:00
Paul Berry 85bac75b0e Ensure that function reference resolution assigns an element and type when the method is inherited.
Change-Id: I2053c625617aa03bcad9ffa920c0ff27823a0a9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217701
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2021-10-22 12:57:17 +00:00
pq d9edb9bc29 add double constants
See: https://github.com/dart-lang/linter/pull/3039

Change-Id: If0a2a02591a0a46c0c463ff2e79f35a1209dff35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217700
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2021-10-22 00:16:56 +00:00
Konstantin Shcheglov 6451799849 API for package:build
Change-Id: I00bb4d6866202d404eee0b8bf6c13b4702cab617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217561
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-21 19:38:35 +00:00
Konstantin Shcheglov 98825d9ebf Remove unused FunctionTypeImpl.relateX() methods.
Change-Id: I579dc738f00cd009c0089eb044b13c4541580465
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-21 18:39:45 +00:00
Konstantin Shcheglov a270ec6f59 update to_source_visitor.dart
GenericTypeAlias from docs
/// A generic type alias.
///
///    functionTypeAlias ::=
///        metadata 'typedef' [SimpleIdentifier] [TypeParameterList]? = [FunctionType] ';'
but you forgot semicolon

Closes https://github.com/dart-lang/sdk/pull/47477
https://github.com/dart-lang/sdk/pull/47477

GitOrigin-RevId: 45625c19e5782ced108a301731c9b8ccb5057339
Change-Id: Id3a11bbc391368aceb0f95368a8661b2a27cada2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217080
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-21 18:35:26 +00:00
Konstantin Shcheglov 00c377c753 Fix LinkedElementFactory.hasLibrary() when the element was linked, not read.
Change-Id: Ida0ca61353af02dcf7086e6a3bd2bd70c6c4a92b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217660
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-21 17:41:05 +00:00
Chloe Stefantsova 29e0c5e2bc Add "super-parameters" experiment flag
Part of https://github.com/dart-lang/sdk/issues/47525.

Change-Id: If7bf6f39b9b3ade1769f158ea1ca45515f859a2a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217640
Auto-Submit: Chloe Stefantsova <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2021-10-21 16:50:15 +00:00
Konstantin Shcheglov bc2de3e037 Expose LibraryContext from AnalysisDriver.
I plan using it internally to build summaries - currently we
re-create LinkedElementFactory.

Change-Id: I1eba20b96aec5eb2e85c1bb2de5549db219ee3d9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217500
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-21 05:25:42 +00:00
Sam Rawlins 57a2e7ef7c Insert new ImplicitCallTearoff nodes at assignability checks.
Fixes half a dozen tests for
https://github.com/dart-lang/sdk/issues/46020

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

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

There are two cases where implicit tear-off conversion should be
performed in desugared code. Because the analyzer does not desugar,
we just make additional checks in assignability:
* for-in statements, where the iterable is an Iterable<C> and C is
  a callable class, and the for-in element is function-typed.
* spread-elements, where the iterable is an Iterable<C> and C is
  a callable class, and the typed literal element type is a
  function type.

This is a breaking change as it involves removing implicit tear-off
conversion from TypeSystem.isAssignableTo.

However, it passes google3 today. :D

Change-Id: I9d852adadc11c92b3f7dbf130965d003c68b2b14
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217157
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-20 21:29:24 +00:00
Simon Binder 02b8407d81 [analyzer] Resolve annotations on local variable elements
Metadata is attached to a `VariableDeclarationList`, not the individual
declarations therein.
Even though annotations from the list are copied down into the local
variable elements, the resolver did not set the `element` property on
those annotations which is required for computing the constant value in
a later step.
This is fixed by making the resolver visit the declaration list instead
of individual declarations.

Closes https://github.com/dart-lang/sdk/issues/47502

Change-Id: Id6e47e6fa878e61be5279fa4127262deb73ab1c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217363
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-20 20:07:12 +00:00
Konstantin Shcheglov 0a3aec4f9b Remove 'withInformative' from link().
The change to remove its only usage internally was landed.
So, we can remove it completely.

Change-Id: I340d6959c0d82945d50879d7744f14bd072d5d36
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217420
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-20 18:36:12 +00:00
Konstantin Shcheglov a38e83536c Revert "Tweaks for MockSdk."
This reverts commit 88f7bfa4e3.

Reason for revert: breaks linter tests.

Original change's description:
> Tweaks for MockSdk.
>
> Change-Id: I43385a92862fd159439e6859cfed22fe4a3597d1
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217445
> Reviewed-by: Samuel Rawlins <srawlins@google.com>
> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>

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

Change-Id: Ifaadb4b1916e19ee48ab48708a8214e9d98815a3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217447
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-20 18:32:15 +00:00
Konstantin Shcheglov 88f7bfa4e3 Tweaks for MockSdk.
Change-Id: I43385a92862fd159439e6859cfed22fe4a3597d1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217445
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-20 18:06:04 +00:00
Paul Berry 0a39aa7cf6 Make all analyzer message arguments non-nullable.
Cases where `null` was being passed as an argument to formatting a
message have all been fixed in previous CLs; all that remains to do is
change the type system to reflect that, and insert `!`s in a few
places.

This brings us one step closer to being able to make analyzer message
formatting type safe.

Change-Id: Id9e0d0b32f29cde0fdc5227417b7a2e3fc3b443d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216272
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-20 11:31:51 +00:00
Ahmed Ashour d041cf0478 Remove extra the, be and of
Fixes #https://github.com/dart-lang/sdk/issues/47504

TEST=No tests needed, only comments affected.

Change-Id: Ie096307b5ce314d328fea6780f396aaa226ad3b0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/216182
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
2021-10-20 09:29:01 +00:00
Konstantin Shcheglov 311760f49c Deprecate 'withInformative' in link()
Change-Id: I6da8baf8cbac140b20351b5b93fc6858603ba8d4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-20 04:03:32 +00:00
Konstantin Shcheglov aed00dc37c Revert "Issue 47073. Inherit covariant-by-declaration from any candidate."
This reverts commit 60535b95de.

Bug: https://b.corp.google.com/issues/203423390
Change-Id: Id096d464b4b992153dd9f3b140b475ec2b7b3b43
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217288
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 23:40:41 +00:00
Konstantin Shcheglov b381186c91 Use runtimeTypesEqual() for FunctionState.isIdentical()
Bug: https://github.com/dart-lang/sdk/issues/46840
Change-Id: I48d257554ad5e4305168e37b18a6dbfc119b78c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217284
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 19:10:23 +00:00
Konstantin Shcheglov 3cd8dfe95b Deprecate MockSdk, switch to createMockSdk().
Change-Id: I512cd93af2f4aeab91f3d739c58c47572f3c4ede
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217151
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 18:52:15 +00:00
Konstantin Shcheglov 95dc8bd415 Patch dart:ui/src/ui references.
Bug: https://buganizer.corp.google.com/issues/203423390
Change-Id: Ibbe2a304b9bbc3dddff684ca8ba1cc41b28507e9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217281
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 18:05:55 +00:00
pq 4d35418b6f fix unused_result false positive
Fixes: https://github.com/dart-lang/sdk/issues/47473

Change-Id: Idc8a7c029dd3f081cda5c0d3d2ca4929156fcc98
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217161
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-10-19 17:09:02 +00:00
Konstantin Shcheglov de16d277d7 Fix MockSdk to be more backward compatible.
Bug: https://buganizer.corp.google.com/issues/203503644
Change-Id: I7dffc8b80597cd21cc41261678e74ba90a4e7e8a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217260
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-19 16:23:42 +00:00
Chloe Stefantsova 82dc2cf255 [analyzer] Disable check for argument order if experiment is enabled
Part of https://github.com/dart-lang/sdk/issues/47451.

Change-Id: I6e13e8642c287c2386f7a323ccd5e41d83c5b358
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217012
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Chloe Stefantsova <dmitryas@google.com>
2021-10-19 09:24:27 +00:00
Sam Rawlins 37b3ed798f Fix references to StaticWarningCodes which are now CompileTimeErrorCodes
Change-Id: I89390b6f89de4301460e092b8828d720ac9c3224
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217155
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2021-10-19 04:54:50 +00:00
Konstantin Shcheglov 5fff311900 Add createMockSdk(), a replacement for MockSdk.
This makes MockSdk a factory for FolderBasedDartSdk.
In a next CL I will deprecate MockSdk, and update SDK clients.

Change-Id: I1a24c70d2e9b902150f80ccaaa8a84d5e385058f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/217150
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-10-18 21:37:54 +00:00