EA-71185 - assert: CallResolverUtilPackage$CallResolverUtil$fcfb.hasUnknownReturnType

- Accept any subclasses of KCallable<R> as "callable reflection types"
(this includes KProperty and KFunction with their subclasses).
- Provide more detailed information on the callable reference type in question in case of assertion failures.
This commit is contained in:
Dmitry Petrov
2015-07-29 12:48:18 +03:00
parent 9bf0211152
commit 8b73ffd25b
2 changed files with 10 additions and 15 deletions
@@ -44,19 +44,19 @@ public enum class ResolveArgumentsMode {
public fun hasUnknownFunctionParameter(type: JetType): Boolean {
assert(ReflectionTypes.isCallableType(type), "type is not a function or property")
assert(ReflectionTypes.isCallableType(type)) { "type $type is not a function or property" }
return getParameterArgumentsOfCallableType(type).any {
TypeUtils.containsSpecialType(it.getType(), DONT_CARE) || ErrorUtils.containsUninferredParameter(it.getType())
}
}
public fun hasUnknownReturnType(type: JetType): Boolean {
assert(ReflectionTypes.isCallableType(type), "type is not a function or property")
assert(ReflectionTypes.isCallableType(type)) { "type $type is not a function or property" }
return ErrorUtils.containsErrorType(getReturnTypeForCallable(type))
}
public fun replaceReturnTypeByUnknown(type: JetType): JetType {
assert(ReflectionTypes.isCallableType(type), "type is not a function or property")
assert(ReflectionTypes.isCallableType(type)) { "type $type is not a function or property" }
val newArguments = Lists.newArrayList<TypeProjection>()
newArguments.addAll(getParameterArgumentsOfCallableType(type))
newArguments.add(TypeProjectionImpl(Variance.INVARIANT, DONT_CARE))