https://kotlinlang.org logo
Title
s

steenooo

12/05/2019, 4:24 PM
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

Holger Steinhauer [Mod]

12/05/2019, 4:34 PM
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

steenooo

12/05/2019, 4:37 PM
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

Holger Steinhauer [Mod]

12/05/2019, 4:51 PM
Hmm, interesting. How does your project structure look like? Is it on GitHub or similar?
s

steenooo

12/05/2019, 5:05 PM
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

Holger Steinhauer [Mod]

12/05/2019, 5:37 PM
I can't imagine. The documentation doesn't mention it either: https://kotlinlang.org/docs/reference/coding-conventions.html#naming-rules
s

steenooo

12/05/2019, 6:19 PM
The code does work properly when it's executed
h

Holger Steinhauer [Mod]

12/05/2019, 6:27 PM
Right now, I'm out of ideas. Might be the late hour. Sorry
s

steenooo

12/05/2019, 6:33 PM
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

Holger Steinhauer [Mod]

12/05/2019, 6:50 PM
Then it would run when you compile and run it via maven ;)
How is your
KotlinPlugin
looking?
s

steenooo

12/05/2019, 6:50 PM
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

Holger Steinhauer [Mod]

12/05/2019, 7:22 PM
Hmm. Looks really more like a visibility issues, but I might be wrong
s

steenooo

12/05/2019, 7:27 PM
When I go to Tools -> kotlin -> Show kotlin bytecode. I get this https://gist.github.com/steenooo/d24ff937b807026ce049c2895e0f2964
Instead of the bytecode
s

Sergei Dubrov [JB]

12/06/2019, 7:33 AM
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

steenooo

12/06/2019, 9:03 AM
I already reported the problem as an IDEA issue, since it doesnt occur with the normal kotlin compiler
:tnx: 2
🆒 1