-
-
Notifications
You must be signed in to change notification settings - Fork 604
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
Should we flatten variables? #84
Comments
Absolutely. But not sure what do you mean by "choose between inherited or direct variables"? |
@ilyapuchka on both questions? what I meant is that it might be useful to be able to differentiate between variables defined in the class vs supertype |
Regarding annotation, I don't think we should propagate them, anyway it's easy to add annotations. |
override makes sense to me, I'll skip differentiation between inherited vs own for now since we don't have use-case |
@ilyapuchka shouldn't we do the same with methods then? I think the way you implemented it now it won't inherit from supertype? |
Sure. Currently it only adds methods from extensions, the same as variables. |
I think flattening all variables by default could lead to duplicate code generation, but a flattened context could still be very useful |
@ilyapuchka @vknabel so what I've right now is:
All our filters e.g. maybe leave |
I think we shouldn't flatten the variables by default but offer a special variable (like So |
@AliSoftware how about the suggestion I added above? keeping |
Accessing super class variables through |
@krzysztofzablocki I prefer |
@krzysztofzablocki so basically we have the same idea (keeping |
Doesn't |
Hence me being open to alternate names. Like |
I think it only make sense to have distinction between local and all variables, thus if we don't want to use
Happy to replace [all, local] with better naming suggestion |
@vknabel @AliSoftware @FilipZawada @ilyapuchka ^ thoughts? I've implemented this already so I just need us to decide on naming |
That means that |
@AliSoftware's point about compatibility is quite strong and I think Alternatively: does it make sense (if possible) to use Stencil filters for this? Like |
I'm adding I've also removed documentation for |
With filters, how do we get the number of static/computed/other variables if we remove dedicated collections for variables? |
Good question, I think Stencil doesn't support () so
|
@ilyapuchka I added count filter that will turn array into its count and since we can chain filters that will work |
Cool, looks pretty elegant solution! Will look closer at your pr later today |
If a type inherits from another type, or implements given protocol, should the variables be available in the given type itself?
e.g.
Should we list typeName in Foo? if so should we add alternative variable so people can choose between inherited or direct variables?
Also same question can be asked in regards to annotations, if the protocol specified type level annotation, should we flatten that into Foo ?
@ilyapuchka what do you think?
The text was updated successfully, but these errors were encountered: