Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/sam/expr/eval.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func NewUnaryMinus(sctx *super.Context, e Evaluator) *UnaryMinus {
}

func (u *UnaryMinus) Eval(this super.Value) super.Value {
val := u.expr.Eval(this).DeunionIntoNameds()
val := u.expr.Eval(this).Under()
if val.IsNull() || val.IsError() {
return val
}
Expand Down
2 changes: 1 addition & 1 deletion runtime/vam/expr/logic.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (*Or) evalWithNullOrError(boolVec, nullOrErrorVec vector.Any) vector.Any {
// slot and they are returned as an error. If all of the value slots are errors,
// then the return value is nil.
func evalBool(sctx *super.Context, fn func(...vector.Any) vector.Any, vecs ...vector.Any) vector.Any {
return vector.Apply(vector.ApplyRipUnions, func(vecs ...vector.Any) vector.Any {
return vector.Apply(vector.ApplyRipUnions|vector.ApplyRipFusions, func(vecs ...vector.Any) vector.Any {
for i, vec := range vecs {
vec := vector.Under(vec)
if k := vec.Kind(); k == vector.KindBool || k == vector.KindNull || k == vector.KindError {
Expand Down
2 changes: 1 addition & 1 deletion runtime/vam/expr/unaryminus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func NewUnaryMinus(sctx *super.Context, eval Evaluator) Evaluator {
}

func (u *unaryMinus) Eval(this vector.Any) vector.Any {
return vector.Apply(vector.ApplyRipUnions, u.eval, u.expr.Eval(this))
return vector.Apply(vector.ApplyRipUnions|vector.ApplyRipFusions, u.eval, u.expr.Eval(this))
}

func (u *unaryMinus) eval(vecs ...vector.Any) vector.Any {
Expand Down
4 changes: 4 additions & 0 deletions runtime/ztests/expr/unary-minus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ input: |
error(1)::(null|error(int64))
null
null::(int64|null)
fusion(1::(int64|null),<int64>)
fusion(error(1)::(error(int64)|int64),<error(int64)>)

output: |
-1::int8
Expand Down Expand Up @@ -57,3 +59,5 @@ output: |
error(1)
null
null
-1
error(1)
2 changes: 2 additions & 0 deletions runtime/ztests/expr/unary-not.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ spq: values [!this, not this]
input: |
false
true
fusion(false::(bool|null),<bool>)

output: |
[true,true]
[false,false]
[true,true]
Loading