Use numeric_limits

pull/6/head
A. R. Shajii 2021-11-03 18:09:56 -04:00
parent 8f827da254
commit dab555ae94
1 changed files with 2 additions and 1 deletions

View File

@ -1,3 +1,4 @@
#include <limits>
#include <map>
#include <memory>
#include <string>
@ -278,7 +279,7 @@ std::pair<int, StmtPtr> TypecheckVisitor::inferTypes(StmtPtr result, bool keepLa
int minUnbound = ctx->cache->unboundCount;
ctx->addBlock();
int iteration = 0;
for (int prevSize = INT_MAX;;) {
for (int prevSize = std::numeric_limits<int>::max();;) {
LOG_TYPECHECK("== iter {} ==========================================", iteration);
ctx->typecheckLevel++;
result = TypecheckVisitor(ctx).transform(result);