I’m attempting to build our repo with 1.4-M3, but ...
# eap
z
I’m attempting to build our repo with 1.4-M3, but get a strange compile error on a random bit code
The feature “unit conversion” is disabled
Copy code
private class OnJobDone(
    private val jobDone: (Job) -> Unit,
    val allDone: () -> Unit
)

private val callbacks = OnJobDone(
    jobDone = jobToChannelId andThen trackChannelSynced,
    // Fails on the next line
    allDone = {
      // ...
    }
)
l
Does that snippet fail to compile in a new/blank project or on try.kotl.in when you select Kotlin 1.4?
z
try.kotl.in only has 1.4-M1. Worked fine with m1 and m2
still working on getting a consistent local repro, weirdly
boom got it reproducing locally, finally
@mikhail.zarechenskiy it looks like this was recently added https://github.com/JetBrains/kotlin/commit/71cbe9768869db76b6ee54f44faca7d75de7be6f#diff-7452279877696ef5b9e37340da047d77 Digging through the code and trying to understand it, but it seems that
UnitConversionCallChecker
is erroneously being enabled everywhere even if the feature is not explicitly enabled, and now any lambda/function argument that could be subject to it appears to be getting checked by it. Not sure if that’s the right read though. If I manually enable it via
-XXLanguage:+UnitConversion
then it works, but for a feature that I’m not explicitly trying to use in existing source this seems like a bug. It also requires that I add
-XXLanguage:+NewInference
, even though thought the new type inference algorithm was enabled by default in 1.4. Did that change between M2 and M3?
l
Linking the issue link you reported for reference: https://youtrack.jetbrains.com/issue/KT-40351