Unresolved references in IntelliJ, compilation is ok

Hello,

I’m working on a project where we support JVM, Linux, macOS and Windows platform.

The structure is:

  • common module with almost all code

  • JVM module with JVM implementation of expected classes/funs

  • native module called native with almost all expected code except for some IO

  • linux/macos module called posix with the implementation of IO; depends on native module

  • mingw module called mingw with the implementation of IO; depends on native module

The project is structured as describe above because there are some small differences between linux/macos and Windows. Just one class. The rest of the native code is the same.

Everything builds just fine and works as expected.

However, the native module is not recognized as a native one and IntelliJ thus report unresolved references.

I can, of course, add something like linuxX64("native") to markt he project as native one but it won’t compile as the native module doesn’t implement expected class for IO.

If I add dummy implementation, the compilation fails because there are more than one implementation for expected class.

I would somehow need to mark the native module as being native but not containing the complete implementation.

I can use @Suppress("NO_ACTUAL_FOR_EXPECT") to suppress the error, but that’s a bit dangerous.

Any ideas?

Hello, @vhodek! As far as I can see, you’re talking about the hierarchical project structure support. This feature is being discussed for a long time, and was supported in 1.4-M2 version (see blog post here). Please try using it with 1.4-M2, 1.4-M3, or wait for the 1.4 official release.

Thanks for the information. I’m talking exactly about the hierarchical structure of platform specific modules.

I can’t switch to 1.4-M2/3 now but with the @Suppress("NO_ACTUAL_FOR_EXPECT") is viable solution for me now.

I will gladly test it with 1.4 once the official release is out.