-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
@extend
does not work with parameters
#3061
Comments
One must list all the args (parameter or variable), of a sub-component or a base-system, that should be added to the arglist of the main-component. This will fix the issue: @mtkmodel Outer begin
@extend () = v = Inner(; color, render)
@parameters begin
radius = 0.1, [description = "Radius of the sphere in animations"]
end
end |
The component that is extended may have 10s-100s of parameters and variables, if we have to type them all out it kind-of defeats the purpose of extending something in the first place? |
It was mainly to keep the syntax same in both cases. If it is more convenient, I can modify the case for |
That sounds good to me, and aligns with what I would expect from inheritance |
The problem with adding the args explicitly after extending is that they are not optional anymore. You always have to provide |
That might be a problem with the current implementation, it does not mean that we can't change the implementation to something better? |
Note that, even now mtkmodel handles it gracefully. It adds Extending all args to main component automatically, will also handle it the same way; all args will be available but remain optional. (I expect this to land soon) |
Good. Another |
When using
@mtkmodel
and@extend
, the constructor does not know about the parameters of the extended system. MWE:The text was updated successfully, but these errors were encountered: