Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/builderInference/upperBoundViolation.kt
T
2023-03-24 14:27:03 +00:00

12 lines
305 B
Kotlin
Vendored

// !RENDER_DIAGNOSTICS_FULL_TEXT
// ISSUE: KT-55055
// FIR_DUMP
fun <T : Number> printGenericNumber(t: T) = println("Number is $t")
fun main() {
buildList { // inferred into MutableList<String>
add("Boom")
<!UPPER_BOUND_VIOLATION_IN_CONSTRAINT!>printGenericNumber(this[0])<!>
}
}