class Bar<T : Any?> {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

}

fun <T : Any?> Bar<T>.parameterizedExt() {
}

fun Bar<Int>.specificExt() {
}

fun test_1_1(x: Any) {
  x as Bar<String> /*~> Unit */
  x /*as Bar<String> */ as Bar<Int> /*~> Unit */
  specificExt(/* <this> = x /*as Bar<Int> */ */)
}

fun test_1_2(x: Any) {
  x as Bar<Int> /*~> Unit */
  x /*as Bar<Int> */ as Bar<String> /*~> Unit */
  specificExt(/* <this> = x /*as Bar<Int> */ */)
}

fun test_2_1(x: Any) {
  x as Bar<String> /*~> Unit */
  x /*as Bar<String> */ as Bar<Int> /*~> Unit */
  parameterizedExt<String>(/* <this> = x /*as Bar<String> */ */)
  parameterizedExt<Int>(/* <this> = x /*as Bar<Int> */ */)
}

fun test_2_2(x: Any) {
  x as Bar<Int> /*~> Unit */
  x /*as Bar<Int> */ as Bar<String> /*~> Unit */
  parameterizedExt<String>(/* <this> = x /*as Bar<String> */ */)
  parameterizedExt<Int>(/* <this> = x /*as Bar<Int> */ */)
}

