[KAPT] Don't fail on illegal delegate

Kapt ignores error diagnostics, but backend can't
 compile such code at all
This is workaround so backend won't fail.
#KT-46176 Fixed
This commit is contained in:
Andrey Zinovyev
2021-04-21 13:28:30 +03:00
committed by TeamCityServer
parent 0c0710bb79
commit 0c6066db74
5 changed files with 90 additions and 1 deletions
@@ -188,6 +188,12 @@ class JvmRuntimeTypes(
else -> if (isMutable) mutablePropertyReferences else propertyReferences
}
return classes[arity].defaultType
return if (arity >= 0) {
classes[arity].defaultType
} else {
//in case of ErrorUtils.ERROR_PROPERTY there would be no dispatchReceiverParameter and arity becomes negative
//so we just take zero argument reference class (because it is incorrect anyway)
classes[0].defaultType
}
}
}