Skip to content

Commit 52abe35

Browse files
committed
Added same type requesting to add and mult
1 parent 9330f14 commit 52abe35

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/lib/compiler/expressions.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,9 @@ func (ctx *Context) compileAdditive(a *parser.Additive) (value.Value, error) {
369369

370370
lrop := a.Op
371371
for _, right := range a.Right {
372+
ctx.RequestedType = left.Type()
372373
rightVal, err := ctx.compileAdditive(right)
374+
ctx.RequestedType = nil
373375
if err != nil {
374376
return nil, err
375377
}
@@ -435,7 +437,9 @@ func (ctx *Context) compileMultiplicative(m *parser.Multiplicative) (value.Value
435437

436438
lrop := m.Op
437439
for _, right := range m.Right {
440+
ctx.RequestedType = left.Type()
438441
rightVal, err := ctx.compileMultiplicative(right)
442+
ctx.RequestedType = nil
439443
if err != nil {
440444
return nil, err
441445
}

0 commit comments

Comments
 (0)