Skip to content

Commit 0a24bf1

Browse files
committed
Fix type deserialization for suspend function types which was written by pre-release compiler.
Notes: if arity == 0, it means that type was `suspend () -> String` => arguments.size == 1, and it means that SuspendFunction0 has only one type argument and it is return type.
1 parent 81df764 commit 0a24bf1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/deserialization/src/org/jetbrains/kotlin/serialization/deserialization/TypeDeserializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class TypeDeserializer(
147147
// This case for types written by eap compiler 1.1
148148
1 -> {
149149
val arity = arguments.size - 1
150-
if (arity > 0) {
150+
if (arity >= 0) {
151151
KotlinTypeFactory.simpleType(annotations, functionTypeConstructor.builtIns.getSuspendFunction(arity).typeConstructor, arguments, nullable)
152152
}
153153
else {

0 commit comments

Comments
 (0)