Does it make sense that the new smart casts will show as an error in the IDE until I start using the 2.0 IDEA plugin?
👍 1
👍🏼 1
👍🏾 1
k
kirillrakhman
07/01/2024, 6:47 AM
That's an unfortunate consequence of using the K1 mode with K2 compiler.
g
gildor
07/02/2024, 4:57 AM
We also noticed this. Would be great if it was possible to at least temprorary disable compiler warnings for k2, otherwise it creates a lot of confusion, especially with "warnings as errors" enabled
👎🏾 1
d
dmitriy.novozhilov
07/02/2024, 6:11 AM
If you are talking about warnings caused by more precise smartcasts (like unnecessary safe call or useless cast) it's not possible, because it basically means duplication of K1 DFA logic in K2
When we migrated the kotlin repo to use K2 for compilation we just added some
@Suppress
annotations in places where K1 (in IDE) shows nothing and K2 shows warnings
g
gildor
07/02/2024, 6:18 AM
I see, thanks for explanation
Yes, suppress is what we use now
gildor
07/05/2024, 9:49 AM
@efemoney What? It's just practical. Of course I want warnings, I just don't want warnings to be inconsistent with IDE. I meant only inconsistent ones, not all of course. But as Dmitriy pointed out, it's not really feasable and makes sense