Skip to content

Commit

Permalink
fix portion type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
ascandone committed Feb 12, 2025
1 parent 27a0945 commit 432c5ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/analysis/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ func (res *CheckResult) checkTypeOf(lit parser.ValueExpr) string {
case parser.InfixOperatorMinus:
return res.checkInfixOverload(lit, []string{TypeNumber, TypeMonetary})

case parser.InfixOperatorDiv:
res.checkExpression(lit.Left, TypeNumber)
res.checkExpression(lit.Right, TypeNumber)
return TypePortion

default:
// we should never get here
// but just to be sure
Expand Down

0 comments on commit 432c5ac

Please sign in to comment.