Package org.codehaus.groovy.transform.stc

# Class TypeCheckingContext.EnclosingClosure

java.lang.Object
org.codehaus.groovy.transform.stc.TypeCheckingContext.EnclosingClosure

Enclosing class:
  TypeCheckingContext

public static class TypeCheckingContext.EnclosingClosure extends Object
Represents the context of an enclosing closure. An enclosing closure wraps a closure expression and the list of return types found in the closure body.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `EnclosingClosure(ClosureExpression closureExpression)`
  Creates metadata for an enclosing closure.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addReturnType(ClassNode type)`
  Records another inferred closure return type.
  `ClosureExpression`
  `getClosureExpression()`
  Returns the wrapped closure expression.
  `List<ClassNode>`
  `getReturnTypes()`
  Returns the return types collected for the closure body.
  `String`
  `toString()`
  Returns a diagnostic representation of this closure context.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### EnclosingClosure

    public EnclosingClosure(ClosureExpression closureExpression)
    Creates metadata for an enclosing closure.

- ## Method Details

  - ### getClosureExpression

    public ClosureExpression getClosureExpression()
    Returns the wrapped closure expression.

  - ### getReturnTypes

    public List<ClassNode> getReturnTypes()
    Returns the return types collected for the closure body.

  - ### addReturnType

    public void addReturnType(ClassNode type)
    Records another inferred closure return type.

  - ### toString

    public String toString()
    Returns a diagnostic representation of this closure context.
    Overrides:
      `toString` in class `Object`