-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add support for treating generic method parameters as dynamic in all contexts #27460
Comments
I have sent a cl for review addressing this in the VM. I did not add another mode, and the new behavior is what you get with --generic-method-syntax. |
Actually, I recommended a change to the vm implementation in #27437 such that it would treat a method type parameter as An The In short, I'm not convinced that we should let |
The CL https://codereview.chromium.org/2388843002/ implements a new semantics for |
Note that we haven't actually settled what the semantics should be. |
I'm not sure allowing Independently reopening since only the VM would satisfy the original request (and this issue has also been filed for dart2js and the language). |
Yes, it's really not ideal that we will get different behavior on the VM/dart2js vs DDC for these checks, but unfortunately we're already in that state because of the comment syntax. I did some code searching, and I can't find any uses of the comment syntax for We may want to consider issuing a static warning for |
Removed area-dart2js and area-vm from the bug. Yes. I think |
We discussed this in the language meeting this morning, and will follow up with clarification shortly. Sorry for the confusion. |
We have an informal spec for this. I believe that the VM implementation is already compatible with this. @crelier can you please verify, and close this bug if so? |
According to the revised informal spec, the errors resulting from using a function type parameter in some contexts are always static errors, and not compile time or run time errors. Therefore, the implementation in the VM is free to map a function type parameter to dynamic in all contexts, which it does today. |
Very good, thanks! |
The current implementation of generic method syntax in the VM and dart2js treats generic type parameters as malformed types, which get mapped to
dynamic
in some (but not all) contexts. In particular, they are not usable inis
oras
checks. In order to remove the comment syntax fully from strong mode, we will need an option in the VM and dart2js to enable a mode in which all uses of generic method parameters are mapped todynamic
.The text was updated successfully, but these errors were encountered: