Closed lsoares closed 1 year ago
In jte the same rules apply as in a regular Kotlin program, so I think this is not possible.
but you can have a regular Kotlin program without package. here, WebApp (with main) is in the root and it works fine.
Yes, but you cannot import WebApp.kt from any other Kotlin package (at least if this works in Kotlin the same as in Java).
And jte template classes are generated by default in a package.
do you mean this?
Yes, in Java I get this compile error Class 'X' is in the default package
. So this is working in Kotlin?
Did you try this in your kte template then?
@import X
yeah it has no compilation errors. I believe Kotlin is less restrictive in that regard.
There's no error in the jte plugin. only when I run the app
If I do @import Car as you said then there's an error in jte plugin which could have helped me but since it doesn't complain I was puzzled for a while.
Closed this as not planned, because we can't do anything about it in jte itself.
I opened a ticket in the intellij plugin, to see if we can provide a better error message: https://github.com/casid/jte-intellij/issues/30
If I have a class (in my case a Kotlin data class) in the root package, it can't be referenced in the templates. It's simply not found by jte generating a 500 error. Does it make sense to support it or do we assume that everyone uses a package? I bumped into this while creating a minimalistic tutorial for jte.