random thought of the day: it would be cool if Kotlin had a feature where annotations could apply super powers to a scope so that the file would compile even if the code in that scope doesn’t compile. Use case: tests annotated with
@Test
, if it doesn’t compile, the test fails, but the other tests still run
ah, that’s exactly what I was talking about, neat!
August Lilleaas
09/10/2022, 11:24 AM
almost, at least, I suppose the downside of this is that it’ll get ignored, instead of reported as a failing test
e
ephemient
09/10/2022, 11:25 AM
If you try to run the code that was broken during compilation, you'll get a runtime exception.
a test with non-compiling code should fail in that mode
a
August Lilleaas
09/10/2022, 11:25 AM
aah, right. Sounds perfect, then, the annotation will remain, but the body of the function will just throw?
e
ephemient
09/10/2022, 11:26 AM
this is only on JS/IR and I haven't looked into how it works. but the documentation reads as though it'll fail when it gets to the broken part of the code, so potentially part of the function could still run