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.
This commit is contained in:
Stanislav Erokhin
2017-02-21 17:26:07 +03:00
parent 81df7645e0
commit 0a24bf1613
@@ -147,7 +147,7 @@ class TypeDeserializer(
// This case for types written by eap compiler 1.1
1 -> {
val arity = arguments.size - 1
if (arity > 0) {
if (arity >= 0) {
KotlinTypeFactory.simpleType(annotations, functionTypeConstructor.builtIns.getSuspendFunction(arity).typeConstructor, arguments, nullable)
}
else {