Implement makeNullableAsSpecified for TypeTemplate properly
This change fixes an SOE in isCastErased:
@JvmStatic
fun isCastErased(supertype: KotlinType, subtype: KotlinType, typeChecker: KotlinTypeChecker): Boolean {
if (supertype.isMarkedNullable || subtype.isMarkedNullable) {
return isCastErased(TypeUtils.makeNotNullable(supertype), TypeUtils.makeNotNullable(subtype), typeChecker)
}
TypeUtils.makeNotNullable(TypeTemplate) should not return the same object
if isMarkedNullable returned true on the instance
#KT-15516 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// SKIP_TXT
|
||||
class StateMachine<Q> internal constructor() {
|
||||
fun getInputStub(): Q = null as Q
|
||||
}
|
||||
|
||||
fun <T> stateMachine(<!UNUSED_PARAMETER!>block<!>: suspend StateMachine<T>.() -> Unit): StateMachine<T> {
|
||||
return StateMachine<T>()
|
||||
}
|
||||
|
||||
class Problem<F>(){
|
||||
fun getInputStub(): F = null as F
|
||||
|
||||
fun createStateMachine(): StateMachine<F> = stateMachine {
|
||||
val letter = getInputStub()
|
||||
if (letter is Any)
|
||||
println("yes")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user