-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Allow & Dynamic<T> #10454
Allow & Dynamic<T> #10454
Conversation
Could this also [be made to] work with This is something that would be very useful for react externs, as components there often accept a well defined list of attributes (props) and also pretty much anything else, that would be transferred to child components or something (that's what you get for asking javascript developers to define some typing rules I guess :P) |
Both of these work already. |
Thanks! Can't wait for 4.3 :P |
What if there is a typo error? The compiler doesn't seem to remind you var d:KnownDynamic<Int> = { knowm: 12 }; // typo |
That errors with |
| None -> | ||
extends_dynamic := Some t; | ||
| Some _ -> | ||
display_error ctx "Can only extend one Dynamic<T>" p |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check if current T
is not compatible with the one stored in extends_dynamic
?
Theoretically multiple Dynamic<T>
could get into tl
from different sources.
It seems this kind of signatures would have issues when both //@:generic
function unite<A,B,C:A&B>(a:A, b:B):C; |
Hmm, I expected unification to handle that case already, but it looks like it doesn't do anything with |
I found this: #3228 This means that the |
This approach isn't good so I'll close this for now. |
Allows this:
We have this
Extend
thing foranon_status
which I'm using to implement this. In that context, I've noticed thatapply_params
doesn't recurse into it, which is likely a separate bug.@RealyUniqueName Could you check this? I might have missed something.
CI failure is unrelated.
closes #9825