Is it not recommended naming a package "default" o...
# intellij
j
Is it not recommended naming a package "default" or why do I get this error?
w
default
is a java keyword, I suppose that’s why you can’t use it in package name
s
it is probably a reserved keyword, like java
j
hmm ok
k
You can't create Java classes in a package ending in ".default" because
default
is a keyword in Java. You can have a package with such as name as long as it's only got Kotlin classes. I'm not sure why IntelliJ is preventing you creating one.
j
ok so it does not create problems as I only use Kotlin classes?
k
I think, theoretically... but I haven't tried it.
c
you should report that as a bug. idea can warn about it but its not invalid. see also https://youtrack.jetbrains.com/issue/KTIJ-21533/IDE-should-not-warn-about-reserved-java-names-in-package-names-in-a-pure-kotlin-project for a related issue.
“… is invalid destination package name” is not even a sentence
w
I think it is though 😛 It’s a move refactoring, so you’re specifying the package name of the destination
k
It's missing the indefinite article and a full stop - oh well, enough pedantry 😂
c
I would not report a bug about the sentence but the whole error message is a bug.