use of groovy.transform.stc.ClosureSignatureConflictResolver in project groovy by apache.
the class StaticTypeCheckingVisitor method resolveWithResolver.
private List<ClassNode[]> resolveWithResolver(List<ClassNode[]> candidates, ClassNode receiver, Expression arguments, final ClosureExpression expression, final MethodNode selectedMethod, final Expression resolverClass, final Expression options) {
// initialize resolver
try {
ClassLoader transformLoader = getTransformLoader();
@SuppressWarnings("unchecked") Class<? extends ClosureSignatureConflictResolver> resolver = (Class<? extends ClosureSignatureConflictResolver>) transformLoader.loadClass(resolverClass.getText());
ClosureSignatureConflictResolver resolverInstance = resolver.newInstance();
return resolverInstance.resolve(candidates, receiver, arguments, expression, selectedMethod instanceof ExtensionMethodNode ? ((ExtensionMethodNode) selectedMethod).getExtensionMethodNode() : selectedMethod, typeCheckingContext.source, typeCheckingContext.compilationUnit, convertToStringArray(options));
} catch (ClassNotFoundException e) {
throw new GroovyBugError(e);
} catch (InstantiationException e) {
throw new GroovyBugError(e);
} catch (IllegalAccessException e) {
throw new GroovyBugError(e);
}
}
Aggregations