random thought of the day: it would be cool if Kot...
# compiler
a
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
a
ah, that’s exactly what I was talking about, neat!
almost, at least, I suppose the downside of this is that it’ll get ignored, instead of reported as a failing test
e
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
aah, right. Sounds perfect, then, the annotation will remain, but the body of the function will just throw?
e
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