Hi, I am not quite sure if this is the right chann...
# compiler
j
Hi, I am not quite sure if this is the right channel, but I've encountered a problem, where a change in a class resulted in a cast failing somewhere else. I got a warning in IntelliJ saying that this cast would never succeed which was true. Why is this not an error at compile-time? If I were sure, that a cast that is marked as problematic will succeed, I could add an annotation so that it supresses the error if I really wanted to. Is this configurable somewhere?
d
Why is this not an error at compile-time?
Such code still could be compiled and executed with an expected result, so this is a warning.
Is this configurable somewhere?
With 2.2.0 (starting from 2.2.0-Beta1) there would be an option to raise a severity of a specific warning to an error using
=Xwarning-level=CAST_NEVER_SUCCEEDS:error
compiler argument (see KT-73606 for details). For now you can only turn all warnings into errors with
-Werror
(which I do recommend anyway, but it's my personal taste)