not sure if this is the right channel for this err...
# compiler
t
not sure if this is the right channel for this error but i'm getting a super weird error from the kotlin
Result
class.
Copy code
val terminatorCheck: Result<Boolean> = terminator.parse(input.slice(), null)
        if (terminatorCheck.getOrThrow() == true) {
          break
        }
is throwing
java.lang.ClassCastException: class kotlin.Result cannot be cast to class java.lang.Boolean
on the if-condition. i've tried stepping through and it all looks like it's set up correctly - the debugger shows that there's a boolean in the
value
field and it's not a failure. any idea why
value as T
from the inline function
getOrThrow
would produce this error?
it's also happening in some other places in my code when using
getOrElse { ... }
, but not everywhere. the same code will sometimes pass and sometimes fail and i have no idea why it's inconsistent
d
Please create an issue in the YouTrack
👍 1