[tests] Add test data for KT-55281
This commit is contained in:
committed by
Space Team
parent
6532eb4c60
commit
4021e022b7
@@ -0,0 +1,31 @@
|
||||
// ISSUE: KT-55281
|
||||
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// IGNORE_BACKEND_K2: ANY
|
||||
// REASON: red code (see corresponding diagnostic test)
|
||||
|
||||
fun box(): String {
|
||||
build {
|
||||
this as DerivedBuildee<*>
|
||||
consumeNullableAny(getTypeVariable())
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class TargetType
|
||||
|
||||
fun consumeNullableAny(value: Any?) {}
|
||||
|
||||
open class Buildee<TV> {
|
||||
fun getTypeVariable(): TV = storage
|
||||
private var storage: TV = null as TV
|
||||
}
|
||||
|
||||
class DerivedBuildee<TA>: Buildee<TA>()
|
||||
|
||||
fun <PTV> build(instructions: Buildee<PTV>.() -> Unit): Buildee<PTV> {
|
||||
return DerivedBuildee<PTV>().apply(instructions)
|
||||
}
|
||||
Reference in New Issue
Block a user