class A : Java1<Int> {
  constructor() /* primary */ {
    super/*Java1*/<Int>()
    /* <init>() */

  }

}

class B : Java1<Int> {
  constructor() /* primary */ {
    super/*Java1*/<Int>()
    /* <init>() */

  }

  override fun bar(): Int {
    return 1
  }

  override fun foo(t: Int?) {
  }

}

abstract class C : Java2<Double> {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

}

class D : Java2<Double> {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

  override fun bar(): Double {
    return 1.1
  }

  override fun foo(t: Double) {
  }

}

abstract class E : Java3 {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

}

class F : Java3 {
  constructor() /* primary */ {
    super/*Any*/()
    /* <init>() */

  }

  override fun <U : Number> bar(): U {
    return CHECK_NOT_NULL<Nothing>(arg0 = null)
  }

  override fun <U : Number> foo(a: U) {
  }

}

fun test(a: A, b: B, c: C, d: D, e: E, f: F) {
  a.foo(t = null)
  a.foo(t = 1)
  a.bar() /*~> Unit */
  b.foo(t = null)
  b.foo(t = 1)
  b.bar() /*~> Unit */
  c.foo(t = null)
  c.foo(t = 1.1)
  c.bar() /*~> Unit */
  d.foo(t = 1.1)
  d.bar() /*~> Unit */
  e.foo<@FlexibleNullability Int?>(a = 1)
  e.bar<@FlexibleNullability Int?>() /*~> Unit */
  f.foo<Double>(a = 2.2)
  f.bar<Double>() /*~> Unit */
}
