Closed Ant00000ny closed 3 months ago
For (Java) projects, we use io.spring.initializr.metadata.InitializrConfiguration#hasReservedKeyword
to check for reserved keywords. We should do something similar for Kotlin. It could even be that Kotlin generated projects are checked against Java keywords, which might be another bug.
Not sure if there's a list in the Kotlin source usable somewhere, but the keywords are documented here.
Maybe we can use kotlin.reflect.jvm.internal.impl.renderer.KeywordStringsGenerated#KEYWORDS
for this? Didn't find any documentation explaining its purpose, but the list matches the hard keywords in the documentation though.
Maybe. jvm.internal.impl
doesn't sound like public API, though.
Superseded by https://github.com/spring-io/initializr/pull/1555. Thanks @Ant00000ny!
For example if package name is
fun.fantasea.demo
, generated project files are like below:Correct package name should be