bnorm/kotlin-power-assert

FIR Compatibility

Closed this issue · 2 comments

bnorm commented

List of FIR compatibility issues known so far:

  • Kotlin/JS is unable to find possible delegates for class member functions due to CallableId construction issues. Parent class information seems to be missing and converted to a package.
  • Simple arithmetic is performed before kotlin-power-assert plugin transformation. For example, expressions like 1 + 2 are transformed to a constant 3 when dumping IR information. Does this happen at the FIR level?

Both of the issues above seem to be indications that this plugin needs to be converted to FIR to add proper support. The expression transformation probably needs to happen during FIR (if enabled) to maintain all the information needed for proper diagramming.

The second issue might no longer apply, at least on JVM where I tried it. Simple test assertTrue(1 + 2 == 0) using language version 2.0 results in the desired error message:

java.lang.AssertionError: Assertion failed
assertTrue(1 + 2 == 0)
             |   |
             |   false
             3
...

Seems like both issues have been resolved. Building the sample project completes now without errors using K2.