Skip to content

Commit

Permalink
Force negation expressions to be of type Int.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaqx0r committed Sep 2, 2016
1 parent 233de46 commit af4351a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vm/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ func (c *checker) VisitAfter(node node) {
n.typ = rType

case *unaryExprNode:
n.typ = n.expr.Type()
switch n.op {
case NOT:
n.typ = Int
default:
n.typ = n.expr.Type()
}

}
}

0 comments on commit af4351a

Please sign in to comment.