https://kotlinlang.org logo
#android
Title
# android
m

Marc Knaup

03/16/2020, 9:34 PM
IDEA report a type mismatch here while Android Studio doesn’t. Both use latest Kotlin 1.3.70 plugin with New Inference enabled. Why is that? If I try to compile the code that Android Studio accepts, I also get the same error there at compile-time. It’s just the IDE that doesn’t report it. RxJava3’s
Function…
is marked
@FunctionalInterface
. Is it supposed to work like I’m trying to use it or isn’t it? 🙂
Make sure in AS project you have NI enabled in build.gradle, it should definitely propagate to IDE analysis. So the error will be reported in both IDE and Gradle build.
Copy code
allprojects {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
        kotlinOptions {
            freeCompilerArgs += "-Xnew-inference"
        }
    }
}
17 Views