I may have hit a compiler bug. If I use the HTML D...
# compiler
b
I may have hit a compiler bug. If I use the HTML DSL in my project with tbody { tr{ td{ }}} , the more tr I add in my code , the slower it compiles. Having one it compiles in ~30s, adding another one it takes 1min30, and I stopped it after 4 min when I have three… (edited)
Copy code
tr {
    td { +"Smiles" }
    td { +molecule.smiles }
}
This is the kind of block I add  molecule.smiles is a String
It happens both with 1.3.72 and 1.4M1
How can I disable the new inference engine in gradle?
I can share the project privately if that can help finding why the compiler hangs on such simple code
if I remove those few lines of the generatorHTML, it goes down to 2s build time…
even a much simpler version takes >1min to compile…
I tried to say "as String" to help the inference engine but that doesn't help
m
How can I disable the new inference engine in gradle?
You can add
-XXLanguage:-NewInference
free compiler key to your build.gradle
Copy code
compileKotlin {
    kotlinOptions {
        freeCompilerArgs += ["-XXLanguage:-NewInference"]
    }
}
I can share the project privately if that can help finding why the compiler hangs on such simple code
Yes, please 🙏 You can add some files that will be visible only for you and us in YouTrack, see https://www.jetbrains.com/help/youtrack/incloud/Set-Visibility-of-Issue-or-Comment.html#visibility-attachments
b
I'm working on a minimal non working example
what is easier, I just give you the kt file (dependency will only be kotlinx html dsl)
or I make a full project (this takes ages with intellij, but I can do that if that helps)
there are no dependencies to my code anymore
i
@bjonnh I have found so far that the problem reproducible with
kotlinx-html
0.7.1, and not reproducible with older versions, e.g. 0.6.11. So while we're investigating it, maybe you can use the older version.
👍 1
b
Thanks! I switched to velocity as I needed that to work quickcly. I mostly posted that because I wanted the compiler to not have bugs 😄
i
Thanks! That's very much appreciated! 🙂
m
Sorry for reviving an old conversation, but I hope this is fixed soon, I got hit with that bug and one of my scripts were taking 30m (!) to compile, were before it did only take 2m at worst.
b
@MrPowerGamerBR you can try to use an earlier version of Kotlin HTML DSL
but the bug is corrected and the fix should appear in the next version of Kotlin
Ilya also found out that compiling with
-Xno-inline
solve temporarily the issue
It will be in 1.4-M3 if you are bleeding-edge