open class Bar : IParentImpl, IChild {
  constructor() /* primary */ {
    super/*IParentImpl*/()
    /* <init>() */

  }

  override fun b(t: String): String {
    return "Bar"
  }

}

open class Foo : IParentImpl, IChild {
  constructor() /* primary */ {
    super/*IParentImpl*/()
    /* <init>() */

  }

  override fun b(t: String): String {
    return "Foo"
  }

}

open class IParentImpl : IParent<String, String> {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

  override fun b(t: String): String {
    return "ParentIntImpl"
  }

}

interface IChild : IParent<String, String> {
}

interface IParent<T : Any?, V : Any?> {
  abstract fun b(t: T): V

}

fun getChild(): IChild? {
  val child: IChild? = Bar()
  val isFooOrBar: Boolean = when {
    child is Foo -> true
    else -> child is Bar
  }
  return when {
    isFooOrBar -> child /*as IChild */
    else -> null
  }
}

fun test(): String? {
  return { // BLOCK
    val tmp_0: IChild? = getChild()
    when {
      EQEQ(arg0 = tmp_0, arg1 = null) -> null
      else -> tmp_0 /*as IChild */.b(t = "")
    }
  }
}

