Class CastExpressionOptimizer

java.lang.Object
org.codehaus.groovy.transform.sc.transformers.CastExpressionOptimizer

public class CastExpressionOptimizer extends Object
Simplifies casts and coercions that the static compiler can safely emit directly.
  • Constructor Details

    • CastExpressionOptimizer

      public CastExpressionOptimizer(StaticCompilationTransformer staticCompilationTransformer)
      Creates a cast optimizer backed by the owning static compilation transformer.
      Parameters:
      staticCompilationTransformer - the shared transformer context
  • Method Details

    • transformCastExpression

      public Expression transformCastExpression(CastExpression cast)
      Rewrites a cast expression when the cast or coercion can be simplified.
      Parameters:
      cast - the cast expression to transform
      Returns:
      the optimized expression