(ctx *OptimizerContext, a *ast.AST)
| 1348 | type testVariadicLogicOptimizer struct{} |
| 1349 | |
| 1350 | func (t *testVariadicLogicOptimizer) Optimize(ctx *OptimizerContext, a *ast.AST) *ast.AST { |
| 1351 | call := ctx.NewCall(operators.LogicalAnd, ctx.NewIdent("x"), ctx.NewLiteral(types.True), ctx.NewIdent("y")) |
| 1352 | return ctx.NewAST(call) |
| 1353 | } |
| 1354 | |
| 1355 | func TestConstantFoldingOptimizer_VariadicShortcircuitLogic(t *testing.T) { |
| 1356 | env, err := NewEnv(Variable("x", BoolType), Variable("y", BoolType)) |
nothing calls this directly
no test coverage detected