Skip to content

Commit

Permalink
Brand new (#5)
Browse files Browse the repository at this point in the history
Fix typechecker error for expressions that contain /

Co-authored-by: Legotier <[email protected]>
  • Loading branch information
LKlinke and Legotier authored Jun 10, 2022
1 parent b09f7f4 commit f6d09ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions probably/pgcl/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def get_type(program: Program,

if check and expr.operator in [
Binop.LEQ, Binop.LT, Binop.GEQ, Binop.GT, Binop.EQ, Binop.PLUS,
Binop.MINUS, Binop.TIMES, Binop.MODULO, Binop.POWER
Binop.MINUS, Binop.TIMES, Binop.MODULO, Binop.POWER, Binop.DIVIDE
]:
rhs_typ = get_type(program, expr.rhs, check=check)
if isinstance(rhs_typ, CheckFail):
Expand All @@ -177,7 +177,7 @@ def get_type(program: Program,

# binops that take numeric operands and return a numeric value
if expr.operator in [
Binop.PLUS, Binop.MINUS, Binop.TIMES, Binop.MODULO, Binop.POWER
Binop.PLUS, Binop.MINUS, Binop.TIMES, Binop.MODULO, Binop.POWER, Binop.DIVIDE
]:
# intentionally lose the bounds on NatType (see NatType documentation)
if isinstance(lhs_typ, NatType) and lhs_typ.bounds is not None:
Expand Down

0 comments on commit f6d09ed

Please sign in to comment.