Thread
#multiplatform
    m

    Marc Knaup

    3 years ago
    Why is a different extension function called depending on whether one is
    expect
    or not? common module:
    sealed class Test {
    	object A : Test()
    }
    If I don't use expect:
    fun Test.print() {
    	when (this) {
    		is Test.A -> print() // calls method below
    	}
    }
    
    fun Test.A.print() { // gets called
    	println("A")
    }
    If I use expect:
    fun Test.print() {
    	when (this) {
    		is Test.A -> print() // recursive call
    	}
    }
    
    expect fun Test.A.print() // not called
    louiscad

    louiscad

    3 years ago
    That seems to be a problem in ambiguity resolution. Could you report it ln kotl.in/issue and link it back here?
    m

    Marc Knaup

    3 years ago