Support Nothing type in typeOf
The proper support will come in KT-15518, but that would be a breaking change even for stable Kotlin without kotlin-reflect. Before that issue is fixed, represent Nothing in types with the Void class, and use a flag in the no-reflect implementation to remember that it's not actually the Void class itself. #KT-39166 Fixed
This commit is contained in:
@@ -98,6 +98,8 @@ fun <KT : KotlinTypeMarker> TypeSystemCommonBackendContext.generateTypeOf(
|
||||
if (intrinsicsSupport.state.stableTypeOf) {
|
||||
if (intrinsicsSupport.isMutableCollectionType(type)) {
|
||||
v.invokestatic(REFLECTION, "mutableCollectionType", Type.getMethodDescriptor(K_TYPE, K_TYPE), false)
|
||||
} else if (type.typeConstructor().isNothingConstructor()) {
|
||||
v.invokestatic(REFLECTION, "nothingType", Type.getMethodDescriptor(K_TYPE, K_TYPE), false)
|
||||
}
|
||||
|
||||
if (type.isFlexible()) {
|
||||
|
||||
Reference in New Issue
Block a user