Browse Source

Type check bug - kills simulator when using min/max.

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@1551 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Dave Parker 16 years ago
parent
commit
acf9a19a33
  1. 2
      prism/src/parser/visitor/TypeCheck.java

2
prism/src/parser/visitor/TypeCheck.java

@ -405,13 +405,13 @@ public class TypeCheck extends ASTTraverse
case ExpressionFunc.MIN: case ExpressionFunc.MIN:
case ExpressionFunc.MAX: case ExpressionFunc.MAX:
// int if all ints, double otherwise // int if all ints, double otherwise
e.setType(TypeInt.getInstance());
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
if (types[i] instanceof TypeDouble) { if (types[i] instanceof TypeDouble) {
e.setType(TypeDouble.getInstance()); e.setType(TypeDouble.getInstance());
break; break;
} }
} }
e.setType(TypeInt.getInstance());
break; break;
case ExpressionFunc.FLOOR: case ExpressionFunc.FLOOR:
case ExpressionFunc.CEIL: case ExpressionFunc.CEIL:

Loading…
Cancel
Save