-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[analyzer] Implement constructor tearoffs support in the analyzer #46233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
20 tasks
dart-bot
pushed a commit
that referenced
this issue
Jun 22, 2021
This feature is also known as "explicit function tear-off type instantiations." This first change adds the merest support for function references, only those with explicit type arguments. This change also bumps all PubPackageResolutionTest tests to opt-in to constructor tear-offs. We support: * top-level functions, static and instance methods, local functions and local variables * prefixed top-level functions We error on: * Wrong number of type arguments * unknown identifier Not included: * static methods with explicit receiver * prefixed static methods * extension methods * erroring on the validity of each type argument * anything to do with implicit type arguments * anything to do with constructor tear-offs * anything to do with type literals #46233 Change-Id: I8437f494f1c3d98cef667f675bb18e79a91c78c6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203801 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
dart-bot
pushed a commit
that referenced
this issue
Jun 22, 2021
Bug: #46233 Change-Id: Id83a1fbbb058ed04c4433a380ed08799b047c11e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204520 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
dart-bot
pushed a commit
that referenced
this issue
Jul 2, 2021
* type literals with explicit type instantiation * the above feature, referring to a type alias * the two above features, with prefixed elements * reworked guards and TODOs for forthcoming constructor tearoffs. Bug: #46233 Change-Id: I9c0b7ef16da0a105c4841e11e014ee2a21933d4a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205440 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
dart-bot
pushed a commit
that referenced
this issue
Jul 6, 2021
* static method access with an explicit receiver * the above, with a type alias of the receiver * the two above, with a prefixed import * many test cases for unsupported things Bug: #46233 Change-Id: I982bc741aa8f57959d342b640921096170e94f0c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/205881 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
dart-bot
pushed a commit
that referenced
this issue
Jul 18, 2021
…aroffs. When an expression which is not a type, not a constructor, and not an identifier for a function, is torn off with type arguments, report DISALLOWED_TYPE_INSTANTIATION_EXPRESSION. When a function expression (without a name) is explicitly torn off with the wrong number of type arguments, report WRONG_NUMBER_OF_TYPE_ARGUMENTS_ANONYMOUS_FUNCTION. This separate error code has text which does not have a slot for a function's name. Add resolution for implicit receiver super-type instance method tearoff. Bug: #46233 Change-Id: I3243e1824e191b6b703b1c995af5e1bd8a242915 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207140 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
dart-bot
pushed a commit
that referenced
this issue
Jul 20, 2021
This change is mostly just extracting out some code into helpers; the `resolve` method was getting extremely long. The block of code extracted into each helper is largely unchanged. Bug: #46233 Change-Id: I057dc31339e6a4d9deee18c881123e488f593ac9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207440 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
dart-bot
pushed a commit
that referenced
this issue
Jul 26, 2021
Only the following short list of elements are allowed to be type- instantiated: top-level function, local function, instance method, constructor, type. Bug: #46233 and Change-Id: I37e2a793b7fb25ef670152490e73b227b7c0cdac #46590 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207643 Reviewed-by: Brian Wilkerson <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]> Commit-Queue: Samuel Rawlins <[email protected]>
Closing: This issue is a duplicate of #46020. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
This issue tracks support of the constructor tearoffs feature. See the enclosing meta-issue for details.
The implementation issues for this feature are needed in order to have a reference when approving test failures. Further information will be added here when the implementation work starts.
The text was updated successfully, but these errors were encountered: