fun <T> f(x: T): Int where T : CharSequence?, T : Comparable<T> {
  return x.compareTo(other = x)
}

fun <T> f2(vararg x: T): Int where T : CharSequence?, T : Comparable<T> {
  return x.get(index = 0).compareTo(other = x.get(index = 0))
}

fun test() {
  f<@FlexibleNullability String?>(x = s() /*!! String */) /*~> Unit */
  f<@FlexibleNullability String?>(x = super<J>.#STRING /*!! String */) /*~> Unit */
  f2<@FlexibleNullability String?>(x = [s() /*!! String */]) /*~> Unit */
  f2<@FlexibleNullability String?>(x = [super<J>.#STRING /*!! String */]) /*~> Unit */
}

