Also remove FunctionTypeImpl.recoverTypeArguments because Analyzer
does not need it anymore.
This CL used to replace GenericFunctionTypeElement based FunctionType(s)
with synthetic FunctionType(s). But this is not enough step, because
ideally we want to do this for all FunctionType(s) in invocations. And
this is too big change that affects many parts of Analyzer to do it now.
R=brianwilkerson@google.com, paulberry@google.com
Change-Id: I180eca03ed249abfafe8d6faa94050a30969f125
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98984
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
And change clients of parser and AstBuilder (within the SDK) to use
it.
Long term, it would be better to store the FeatureSet object directly
in the AstBuilder and remove the existing flags `enableNonNullable`,
`enableSpreadCollections`, `enableControlFlowCollections`, and
`enableControlFlowCollections`. However there are analyzer clients
that currently use these flags. So for now, we simply plumb in the
FeatureSet as a new way of setting AstBuilder flags. Once we've
updated clients to use FeatureSet, we'll publish a breaking version of
the analyzer that removes the old flag API.
Change-Id: I6d37177c40b1a1216956e95f473252aa218d10b8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/100000
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
modern mixins
* Remove AbstractStrongTest.enableNewAnalysisDriver; it is always true.
* Add Element.hasOptionalTypeArgs, which requires changing
AbstractStrongTest to use PackageMixin and PackageMapUriResolver,
instead of the custom _TestUriResolver.
Change-Id: Iecb6e37ed5894d42ad965022a8c52e3b5f625655
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98920
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
This reverts commit 1ad11facec.
Reason for revert: The CL broke the flutter-analyze bot.
Original change's description:
> Fix mustCallSuper for mixins and inherited interfaces:
>
> * If a method overrides a mixed in @mustCallSuper method, it should call super.
> * If a method overrides a method from a supertype, which itself overrides a
> method from an interface, the first method should call super.
>
> Fixes internal b/70374204.
>
> Change-Id: I645de4a288a8c5ffff173e97692f8eb6fe38bdb5
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98443
> Commit-Queue: Samuel Rawlins <srawlins@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
TBR=brianwilkerson@google.com,srawlins@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I9339e6a8933f6d25b3bcbdbac0b6a1d304a3693b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
* If a method overrides a mixed in @mustCallSuper method, it should call super.
* If a method overrides a method from a supertype, which itself overrides a
method from an interface, the first method should call super.
Fixes internal b/70374204.
Change-Id: I645de4a288a8c5ffff173e97692f8eb6fe38bdb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/98443
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
The AST refactor for "UI as code" left behind a few things whose names
ended in "2". This CL deprecates those things and creates
replacements that don't end in "2", so that we keep the API clean. In
a future breaking change release of the analyzer we'll remove the
deprecated things.
The following methods and classes are added:
- ForStatement and ForStatementImpl
- ListLiteral.elements
- SetOrMapLiteral.elements
- AstVisitor.visitForStatement
- AstFactory.forStatement
- NodeLintRegistry.addForStatement
The following methods and classes are deprecated:
- ForStatement2 and ForStatement2Impl
- ListLiteral.elements2
- SetOrMapLiteral.elements2
- AstVisitor.visitForStatement2
- AstFactory.forStatement2
- NodeLintRegistry.addForStatement2
In a similar way to how we did the previous stage of AST migration,
the existing visitors have been modified so that the default
implementation of visitForStatement2 redirects to visitForStatement;
this allows clients to change their overrides of visitForStatement2 to
override visitForStatement instead. Once all clients have been
migrated we will be able to delete the visitForStatement2 method.
Change-Id: Ife5949071fe4cb50791cd4f2f4b99a1bfaad54c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/97360
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This is a breaking change, however clients that switched to using
`Expression.precedence2` (which was introduced in analyzer release
0.35.3) are unaffected. After this change, clients may switch back to
using `Expression.precedence`.
Change-Id: Ia952c44001bdea91d32082add0be7e10c9936181
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/94000
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
This constitutes a breaking change, so the analyzer major version
number is bumped to 36. Clients that have stopped using the removed
data structures (and the methods associated with them) should be
unaffected.
Change-Id: Iab68ecf8d10a13013ebb6b1198c54755225d0eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/95704
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>