At the IR level, are there any rules or assumptions made about the ordering of statements in constructor bodies? In particular, I'd like to have the primary constructor set a field before calling the super constructor or instance initializer, but am worried that there's some level of platform incompatibility I'll run into.
many assumptions are not documented, I recommend writing the code you want to generate, checking IR for it and generating the same thing
r
rnett
07/12/2025, 6:26 PM
Yeah, that's what makes me nervous, there's no way to get the compiler to generate that code. It's possible it's something inherited from Java at the language level (where you can't write it, but the bytecode works fine) but it seems safer to avoid it altogether.