Julius Babies
04/01/2025, 8:01 PMdmitriy.novozhilov
04/02/2025, 6:46 AMWhy 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)