Search in sources :

Example 1 with ClosureSignatureConflictResolver

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);
    }
}
Also used : GroovyBugError(org.codehaus.groovy.GroovyBugError) ClosureSignatureConflictResolver(groovy.transform.stc.ClosureSignatureConflictResolver)

Aggregations

ClosureSignatureConflictResolver (groovy.transform.stc.ClosureSignatureConflictResolver)1 GroovyBugError (org.codehaus.groovy.GroovyBugError)1