-
Notifications
You must be signed in to change notification settings - Fork 28
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
Calling Object members on type literals as receivers #2143
Comments
/cc @eernstg |
Surely, we should consider how the test could perform the intended testing without Next, it should indeed be a compile-time error to try to call a static function named As mentioned here it is possible to call the instance member
That is one way to handle the expected treatment of On the other hand, it would make sense to take the opportunity to test that the compile-time error is reported for |
Interesting: The test says 'Checks an example from the specification' where |
@chloestefantsova if you don't mind I'll update the tests after landing of your PR |
Sounds good. I'll approve the failures in my CL and will leave a message here when the CL has landed. |
@chloestefantsova https://dart-review.googlesource.com/c/sdk/+/315101?tab=checks is still not landed. May it was replaced by some other changelist? |
@sgrekhov It turned out, this issue requires a breaking change process in order to be resolved. It has been shelved for some time. I hope it can be resolved relatively soon and will update on the progress here. |
Consider the following line from a test.
co19/LanguageFeatures/Constructor-tear-offs/summary_A03_t01.dart
Line 90 in ed5f316
In it
Func
is a type literal referring to the declaration as follows:co19/LanguageFeatures/Constructor-tear-offs/summary_A03_t01.dart
Line 76 in ed5f316
According to a comment in a recent discussion (see dart-lang/sdk#52961 (comment)), that should be a compile time error, and I'm working on a CL that treats it that way (see https://dart-review.googlesource.com/c/sdk/+/315101?tab=checks).
Should the test in question expect a compile-time error in line 90? Alternatively, calls similar to
T.toString()
whereT
is a type literal can be rewritten ascallToString(T)
, wherecallToString
is defined as follows:Here's a list of more of the similar invocations of
Object
members on type literals as receivers.The text was updated successfully, but these errors were encountered: