This message was deleted.
# community-support
s
This message was deleted.
c
Error is
Copy code
Type mismatch: inferred type is T? but T was expected
e
works fine for me in Gradle 8.0
c
In a build script or in a plugin? It’s fine in Intellij in build.gradle.kts but not in a plugin class.
e
both, works fine for me in a includeBuild plugin
c
does your include build use kotlin-dsl?
e
yes
c
That might be why?
e
ah yes, Kotlin intentionally changed behavior https://youtrack.jetbrains.com/issue/KT-48623/Type-nullability-enhancement-improvements and
kotlin-dsl
uses the flag to disable it
c
I don’t follow, does that mean this is a bug in kotlin? Is the Transformer api correctly typed, and using k2 is an ok workaround, or should I expect this to break in the future under k2 as well?
e
there is a package-level
@NonNullApi
in Gradle: https://github.com/gradle/gradle/blob/master/subprojects/core-api/src/main/java/org/gradle/api/package-info.java thus the Transform API is not actually correct
oh actually that should have been moved around as of Gradle 8, so I think it's correct now (?)
c
I’ll write up an issue with a reproducer to at least get it logged.