-
Notifications
You must be signed in to change notification settings - Fork 90
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
@with variables cannot reference those within the same @with #125
Comments
@albert-kam I'd certainly be open to making the multi-with statement version work as well if you were interested in creating a PR and the unit tests. As you point out, nested with statements will always work if you need to work with multiple variables. |
Wen using this snippet: @with (Collection<OrgLocation> locs = org.getLocations())) {
@views.locationsFrag.template(locs) -> {}
} I got a compile error: Even basic not working, I'm doing something wrong?
Sample: @import si.arnes.db.aris.bean.Organization
@import si.arnes.db.aris.bean.OrgLocation
@import static views.Utils.filterPostalLocations
@import java.util.Collection
@args (Organization org, RockerBody content)
Organizacija: @org.getName()
Matična: @org.getRegistrationNumber()
Koda: @org.getCode().name()
@with (Collection<OrgLocation> locs = filterPostalLocations(org.getLocations()))) {
@views.locationsFrag.template(locs) -> {}
} |
Does it work without @with ? |
yes it works, I do it |
So i have this @with in my template:
This will cause
But .. when i do this instead, it runs okay.
Preferably for me though is that all vars within a single @with should be able to see one another, without having to resort to nested @with-s.
Thank you ...
The text was updated successfully, but these errors were encountered: