PHondogo
04/15/2025, 8:02 AMif (e is Error
&& e !is AssertionError
&& e !is NotImplementedError // why compiler complains about "Check for instance is always 'true'." ?
) {
throw e
}
dmitriy.novozhilov
04/15/2025, 8:04 AMPHondogo
04/15/2025, 8:05 AMdmitriy.novozhilov
04/15/2025, 8:05 AM-Wextra -Xuse-fir-experimental-checkers -Xrender-internal-diagnostic-names
incantation in compiler arguments.
If a warning does not appear in compilation logs after that — it's an IDE inspection.
You can also enable IJ's internal mode; then the aforementioned IDs should be displayed right in IDE (pic related).
If a warning does not have an ID after that — it's an IDE inspection.dmitriy.novozhilov
04/15/2025, 8:06 AMPHondogo
04/15/2025, 8:09 AMfun ensureNonCritical(e: Exception) {
if (e is Error
&& e !is NotImplementedError
) {
throw e
}
}
executing using Gradle cmdPHondogo
04/15/2025, 8:10 AMkotlin=2.1.20
dmitriy.novozhilov
04/15/2025, 8:10 AMError
is not a subtype of Exception
.
They both inherit from Throwable
, but there is no subtyping relation between themdmitriy.novozhilov
04/15/2025, 8:11 AMtrue
in the original message, not false
PHondogo
04/15/2025, 8:11 AMPHondogo
04/15/2025, 8:12 AMPHondogo
04/15/2025, 8:13 AMfun ensureNonCritical(e: Exception) {
if (e is Error) {
throw e
}
}
dmitriy.novozhilov
04/15/2025, 8:13 AMPHondogo
04/15/2025, 8:24 AM