I'm using kotlin 1.4-M1 with IR enabled and found ...
# compiler
p
I'm using kotlin 1.4-M1 with IR enabled and found out bug in generated code. I want to know is it known bug or I should repot it?
Copy code
abstract class TestBase<T> {
        suspend fun test(value: T) {
            println(doTest(value))
        }

        protected abstract suspend fun doTest(value: T): T
    }

    class TestInherit : TestBase<String>() {
        override suspend fun doTest(value: String): String {
            return value + "/" + value
        }
    }

    @Test
    fun test() {
        runBlocking {
            TestInherit().test("aaa") /* throws exception here java.lang.AbstractMethodError: Receiver class TestInherit does not define or inherit an implementation of the resolved method 'abstract java.lang.Object doTest(java.lang.Object, kotlin.coroutines.Continuation)' of abstract class TestBase. */
        }
    }
If define TestBase without generic it works ok.
Copy code
abstract class TestBase {
        suspend fun test(value: String) {
            println(doTest(value))
        }

        protected abstract suspend fun doTest(value: String): String
    }

    class TestInherit : TestBase() {
        override suspend fun doTest(value: String): String {
            return value + "/" + value
        }
    }

    @Test
    fun test() {
        runBlocking {
            TestInherit().test("aaa") // OK
        }
    }
t
Junit test?
test
located in class?
p
Yes. Junit test. Sample code is located in class. But i dont think it is related how it is launched. It is code generation issue i think.