https://kotlinlang.org logo
d

dimsuz

08/22/2020, 11:55 PM
I have found a bug while using
dev13
, does anyone by chance know if its fixed, or should I report it? Asking because upgrading to later versions could require some effort.
Copy code
Button(
  modifier = if (enabled || MaterialTheme.colors.isLight) borderModifier else Modifier
)
Reversing the order of condition operands fixes compilation. This compiles OK:
Copy code
Button(
  modifier = if (MaterialTheme.colors.isLight || enabled) borderModifier else Modifier
)
I will post a reported exception in the thread >>
Compiler exception:
Copy code
e: java.lang.IllegalStateException: Backend Internal error: Exception during IR lowering
...
Caused by: java.lang.AssertionError: OROR condition should have an 'if a then true' body on its first branch, and an 'if true then b' body on its second branch. Failing expression: WHEN type=kotlin.Boolean origin=OROR
a

Adam Powell

08/23/2020, 12:02 AM
Anything of this nature changed considerably since dev13, please update when you can 🙂
d

dimsuz

08/23/2020, 10:44 AM
Ok, thanks. Will only report if reproduce this on latest version!
This is still reproducible on dev17. Will report then.
4 Views