Skip to content

Commit

Permalink
Fix enum type inference for array literals with empty sets as their f…
Browse files Browse the repository at this point in the history
…irst arguments. Fixes #180.
  • Loading branch information
guidotack committed Jan 8, 2018
1 parent 7c418d0 commit 4c38fa2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/typecheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,13 @@ namespace MiniZinc {
if (ty.st() != vi->type().st()) {
throw TypeError(_env,al.loc(),"non-uniform array literal");
}
if (ty.enumId() != vi->type().enumId()) {
ty.enumId(0);
}
} else {
haveInferredType = true;
ty.st(vi->type().st());
ty.enumId(vi->type().enumId());
}
if (vi->type().bt() != Type::BT_BOT) {
ty.bt(vi->type().bt());
ty.enumId(vi->type().enumId());
}
}
} else {
Expand Down

0 comments on commit 4c38fa2

Please sign in to comment.