Do not produce error classes for not found annotations

This commit is contained in:
Alexander Udalov
2016-03-21 18:54:29 +03:00
parent e915e1548c
commit 8d64ed7f3f
24 changed files with 147 additions and 61 deletions
@@ -48,7 +48,7 @@ class MethodBinding(val method: Method, val argumentDescriptors: List<ValueDescr
fun computeArguments(argumentDescriptors: List<ValueDescriptor>): List<Any> = argumentDescriptors.map { it.getValue() }
fun Class<*>.bindToConstructor(context: ValueResolveContext): ConstructorBinding {
val constructorInfo = getInfo().constructorInfo!!
val constructorInfo = getInfo().constructorInfo ?: error("No constructor for $this: ${getInfo()}")
val candidate = constructorInfo.constructor
return ConstructorBinding(candidate, candidate.bindArguments(constructorInfo.parameters, context))
}