Top Description Constructors Methods
groovy.transform.stc

public Class ClosureSignatureConflictResolver

extends Object
Class Inheritance
Known Direct Subclasses
groovy.transform.stc.PickFirstResolver
Imports
org.codehaus.groovy.ast.ClassNode, .MethodNode, org.codehaus.groovy.ast.expr.ClosureExpression, .Expression, org.codehaus.groovy.control.CompilationUnit, .SourceUnit, java.util.List

If multiple candidate signatures are found after applying type hints, a conflict resolver can attempt to resolve the ambiguity.
Since
2.5.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<ClassNode[]>

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.
resolve
(List<ClassNode[]>
the list of signatures as determined after applying type hints and performing initial inference calculations
candidates
,
ClassNode
the receiver the method is being called on
receiver
,
Expression
the arguments for the closure
arguments
,
ClosureExpression
the closure expression under analysis
closure
,
MethodNode
the method for which a groovy.lang.Closure parameter was annotated with ClosureParams
methodNode
,
SourceUnit
the source unit of the file being compiled
sourceUnit
,
CompilationUnit
the compilation unit of the file being compiled
compilationUnit
,
String[]
the options, corresponding to the ClosureParams#options() found on the annotation
options
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClosureSignatureConflictResolverback to summary
public ClosureSignatureConflictResolver()

Method Detail

resolveback to summary
public List<ClassNode[]> resolve(List<ClassNode[]> candidates, ClassNode receiver, Expression arguments, ClosureExpression closure, MethodNode methodNode, SourceUnit sourceUnit, CompilationUnit compilationUnit, String[] options)
Parameters
candidates:List<ClassNode[]>

the list of signatures as determined after applying type hints and performing initial inference calculations

receiver:ClassNode

the receiver the method is being called on

arguments:Expression

the arguments for the closure

closure:ClosureExpression

the closure expression under analysis

methodNode:MethodNode

the method for which a groovy.lang.Closure parameter was annotated with ClosureParams

sourceUnit:SourceUnit

the source unit of the file being compiled

compilationUnit:CompilationUnit

the compilation unit of the file being compiled

options:String[]

the options, corresponding to the ClosureParams#options() found on the annotation

Returns:List<ClassNode[]>

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.