Does it make sense that the new smart casts will s...
# k2-adopters
e
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
That's an unfortunate consequence of using the K1 mode with K2 compiler.
g
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
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
I see, thanks for explanation Yes, suppress is what we use now
@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