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("")
}
}
}
}