Not sure if it's related to the compiler plugin bu...
# compose
y
Not sure if it's related to the compiler plugin but is there a known issue with the IR compiler where a Java SAM within a suspend function fails to compile? Java interface:
Copy code
public interface JavaInterface {
    // this only happens when the method returns void
    void test();
}
Copy code
class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        GlobalScope.launch {
            test()
        }
    }
}

suspend fun test() {
    withContext(Dispatchers.Default) {
        // sam conversion won't compile
        val listener1 = JavaInterface {
            println("")
        }

        // this works
        val listener2 = object : JavaInterface {
            override fun test() {
                println("")
            }
        }
    }
}
i
I think you are in the wrong channels
l
it is a known issue. suspend functions are not fully supported in the IR backend yet.
y
Thanks @Leland Richardson [G] !