Skip to content

Commit 83cfb02

Browse files
committed
fix: make op.DoOp type pointer type
1 parent a83a374 commit 83cfb02

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

dsl/op/do.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,19 @@ import (
77
)
88

99
func init() {
10-
funcMap[string(DoOp)] = &DoOp
10+
opName := doOp("do")
11+
DoOp = &opName
12+
funcMap["do"] = DoOp
1113
}
1214

1315
type doOp string
1416

1517
// DoOp is "do" operation
16-
var DoOp doOp = "do"
18+
var DoOp *doOp
1719

1820
// String returns operator name
1921
func (*doOp) String() string {
20-
return string(DoOp)
22+
return string(*DoOp)
2123
}
2224

2325
// Bind binds its arguments, and check if the types of values are correct.
@@ -30,7 +32,7 @@ func (*doOp) Bind(args ...types.Value) (*types.Expr, error) {
3032
return nil, err
3133
}
3234
retType := args[len(args)-1].Type()
33-
return types.NewExpr(&DoOp, args, retType), nil
35+
return types.NewExpr(DoOp, args, retType), nil
3436
}
3537

3638
// InvertExpr returns inverted expression: Call Value.Invert() for each argument,

0 commit comments

Comments
 (0)