-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Syntax conflict between multiple type parameter constraints and new function syntax #7006
Comments
This is unrelated to new function type syntax. Same "problem" with old syntax: class Foo<T:(Void->Void)->Void> {} The syntax for a constraint list and |
We could consider introducing |
I like that. Ideally |
Right, if |
Hmm. To the best of my understanding, an intersection type satisfies all of its constituents. This seems to be the case for TypeScript, FlowType and Scala, so chances are I look at this the right way. It makes sense: consider a type as being the set of all valid values for that type, then an intersection of two types is the set of values that are valid for both types. The intersection of two interfaces would therefore be the type which requires all values to implement both interfaces. Therefore |
The terminology has always confused me, but you are right. In that case I revert my opinion from 24 minutes ago and agree that |
We need to decide for 4.0 final |
Another option is to replace |
Just a naive suggestion, if the parser thinks that |
@dpomier the thing is that |
This doesn't parse:
The parser thinks that the
(
is the beginning of a type parameter constraints list. I'm not sure if this is an acceptable limitation because the code clearly looks like it should work, so this could be very confusing for people who don't work on parsers for a living.The text was updated successfully, but these errors were encountered: