Package groovy.transform.stc
Class ClosureSignatureConflictResolver
java.lang.Object
groovy.transform.stc.ClosureSignatureConflictResolver
- Direct Known Subclasses:
PickFirstResolver
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
-
Method Summary
Modifier and TypeMethodDescriptionresolve
(List<ClassNode[]> candidates, ClassNode receiver, Expression arguments, ClosureExpression closure, MethodNode methodNode, SourceUnit sourceUnit, CompilationUnit compilationUnit, String[] options)
-
Constructor Details
-
ClosureSignatureConflictResolver
public ClosureSignatureConflictResolver()
-
-
Method Details
-
resolve
public List<ClassNode[]> resolve(List<ClassNode[]> candidates, ClassNode receiver, Expression arguments, ClosureExpression closure, MethodNode methodNode, SourceUnit sourceUnit, CompilationUnit compilationUnit, String[] options) - Parameters:
candidates
- the list of signatures as determined after applying type hints and performing initial inference calculationsreceiver
- the receiver the method is being called onarguments
- the arguments for the closureclosure
- the closure expression under analysismethodNode
- the method for which aClosure
parameter was annotated withClosureParams
sourceUnit
- the source unit of the file being compiledcompilationUnit
- the compilation unit of the file being compiledoptions
- the options, corresponding to theClosureParams.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.
-