-
-
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
Default type parameters #10518
Default type parameters #10518
Conversation
please include an update for haxe.macro.Printer (needed by haxeparser tests and probably others) |
I have disallowed usage on anything other than types and also adjusted haxe.macro.Printer. I think we're just about ready to merge this now! |
🎉 Is that a hard restriction or mostly to be done with the important part (types) and possibly implement the rest later? |
Well, the main issue is still that there's no syntax to define the type parameters explicitly, and without that this feature makes no sense. |
Should there be a check in the compiler that prevents type parameters without defaults to appear after type parameters with defaults? It makes sense syntactically, it is just really useless because: class Example<T = Int, U = Int, V> { ... } I cannot use the |
And a separate question: why can the default not be a previous type parameter, as in: class Example<T = Int, U = T> { ... } |
I specifically asked for I suppose the other question could be made to work too |
Ah yeah that may not exactly count as agreeing 😅 |
Also pretty wippy, but let's have a PR!