-
Notifications
You must be signed in to change notification settings - Fork 1.7k
CFE accepts implicit invocation of .call
getter via extension
#45551
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
legacy-area-front-end
Legacy: Use area-dart-model instead.
Comments
dart-bot
pushed a commit
that referenced
this issue
Apr 1, 2021
These tests just cover the CFE functionality. Once #44905 is addressed, I'll add test expectations for the analyzer. Note: these tests uncovered two unreelated bugs: #45551 and #45552. Bug: #44897 Change-Id: I465b157afc2cc15bcc5ce083aaa74614313a38a6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193581 Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Leaf Petersen <[email protected]> Reviewed-by: Bob Nystrom <[email protected]>
I believe the analyzer behavior is correct here, and the CFE is missing an error. See sections 13.5 and 17.15.5 here. |
@leafpetersen oops, you are right. Here's the relevant text from section 13.5 (The
|
.call
getter on nullable type via extension.call
getter via extension
dart-bot
pushed a commit
that referenced
this issue
Apr 6, 2021
Previously, the "why not promoted" test cases sort of exercised this bug, but in an unclear way that wasn't really related to the "why not promoted" functionality. Better to have a separate test for it. Bug: #45551 Change-Id: Idd44596f021eb91679a019f9f56da1661363d0d8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/193829 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Paul Berry <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code produces an error in the analyzer, but no error in the CFE:
I believe the CFE behavior is correct.EDIT: analyzer behavior is correct - see Leaf's comment below.c()
should be considered equivalent toc.call()
, and sincecall
is a getter defined on typeC?
, it should be allowed.Note that if line (1) is changed to
void call() {}
(which should be equivalent), then both the analyzer and CFE agree that there is no error.The text was updated successfully, but these errors were encountered: