Class ClosureSignatureConflictResolver

  • Direct Known Subclasses:
    PickFirstResolver

    public class ClosureSignatureConflictResolver
    extends java.lang.Object
    If multiple candidate signatures are found after applying type hints, a conflict resolver can attempt to resolve the ambiguity.
    Since:
    2.5.0
    • Constructor Detail

      • ClosureSignatureConflictResolver

        public ClosureSignatureConflictResolver()
    • Method Detail

      • resolve

        public java.util.List<ClassNode[]> resolve​(java.util.List<ClassNode[]> candidates,
                                                   ClassNode receiver,
                                                   Expression arguments,
                                                   ClosureExpression closure,
                                                   MethodNode methodNode,
                                                   SourceUnit sourceUnit,
                                                   CompilationUnit compilationUnit,
                                                   java.lang.String[] options)
        Parameters:
        candidates - the list of signatures as determined after applying type hints and performing initial inference calculations
        receiver - the receiver the method is being called on
        arguments - the arguments for the closure
        closure - the closure expression under analysis
        methodNode - the method for which a Closure parameter was annotated with ClosureParams
        sourceUnit - the source unit of the file being compiled
        compilationUnit - the compilation unit of the file being compiled
        options - the options, corresponding to the ClosureParams.options() found on the annotation
        Returns:
        a non-null list of signatures, where a signature corresponds to an array of class nodes, each of them matching a parameter. A list with more than one element indicates that all ambiguities haven't yet been resolved.