Changes to singleton objects?

I have been using M2 for a while and have decided to try to upgrade my project and use the kotlin daily build (3392).

There are two problems that I ran into so far:
It’s a major annoyance, but at least it still builds fine

And the fact that none of my calls to object singleton methods work any more (I get unresolved reference errors).
Is that a bug or was something changed in object singletons since M2?


Unfortunately, the Android stuf seems to be broken on the IntelliJ side, and we are working with IDEA people to fix it.

Regarding the singltone objects. This code works fine for me:


object A {
  fun foo() {}

fun foo() {

Could you clarify your report? Thanks.

I have narrowed down the problem to the use of library.

Here are my findings:

I have two files:


package pkg1

public object Singleton {
  public fun m1(): Boolean = true


package pkg2

public class TestClass {
  public fun m1(): Unit {

As long as obj.kt and test.kt are in the same module, there’s no problem.

But if I have two modules (intelliJ idea modules), Module1 and Module2
Module1 has obj.kt
Module2 depends on Module1 and has obj.kt
Then it can’'t find Singleton.m1()


It seems that this issue is related to

Did it work for you in M2?

No, with M2 there were more things that got broken when using modules, so I simply made ntfs junctions to avoid duplicating my code. Not having to do that was one of my main reason for trying to move to the daily builds.

I have entered a bug report:

We didn't manage to cover this problem in M3. Will fix soo, you can star the issue to know when it's fixed.