so i have this situation where i can't use an if/e...
# announcements
c
so i have this situation where i can't use an if/else with some legacy java code
Copy code
/* this is package private in another package */ abstract class Parent
class A : Parent()
class B : Parent()

fun x() {
    if (true) A()
    else B()
}
since it's an expression kotlin tries to get the common return type which is
Parent
and then complains that it's not accessible. i'm not interested in the return type. i don't feel like writing
as Any
at the end of the
if
, is there a better solution?