I have something weird happening. When I try to ex...
# announcements
s
I have something weird happening. When I try to extend a class in a different project, Intellij says it can't find it. but when I just put the import there myself, and extend it. But when I compile it. there isn't a problem. I already restarted Intellij and invalidated the cache
h
Is it some kind of scoping issue? Say, the dependency is set to Test Scope but you try using it in your prod code?
Can you actually run the compiled result?
s
Let me try. ctrl n can actually access the class. Only the actual writing part doesn't recognize it
Interesting. It can find it when I try to access it via Java. but not via a kotlin project
h
Hmm, interesting. How does your project structure look like? Is it on GitHub or similar?
s
The project I'm trying to access is a maven project with 1 module, which contains the files I'm trying to access
the project accessing them is a simple maven project
(They're both Minecraft Spigot Plugins)
I've done similar project structures before. The only thing I changed is the groupId/domain. could it be that kotlin does not allow "dev." to be the top level domain?
h
I can't imagine. The documentation doesn't mention it either: https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules
s
The code does work properly when it's executed
h
Right now, I'm out of ideas. Might be the late hour. Sorry
s
It's very weird. It compiles fine. it runs fine. I can access it through Java. But Intellij can't find the classes
Pretty sure an Intellij problem. I opened "Show Kotlin Bytecode"
and got a big exception
h
Then it would run when you compile and run it via maven ;)
How is your
KotlinPlugin
looking?
s
the ExampleKotlinPlugin project is a minecraft plugin. A different java application loads it with a classloader. I can compile the project with Maven fine. KotlinPlugin is a class from my lib to add better kotlin support to Spigot (Minecraft server type)
h
Hmm. Looks really more like a visibility issues, but I might be wrong
s
When I go to Tools -> kotlin -> Show kotlin bytecode. I get this https://gist.github.com/steenooo/d24ff937b807026ce049c2895e0f2964
Instead of the bytecode
s
Hi @steenooo! It sound unfamiliar. Please report an issue at https://youtrack.jetbrains.com/issues/KT. If possible link/attach the reproducer project or provide a sample code. Thanks in advance!
👍 1
s
I already reported the problem as an IDEA issue, since it doesnt occur with the normal kotlin compiler
🙏 2
🆒 1