diff options
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index e97bcc3..7b437c8 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -26,7 +26,7 @@ static void constrain_symbol(TEnv& tenv, Constraints& c, const ASymbol* sym) throw(Error) { const AType** ref = tenv.ref(sym); - THROW_IF(!ref, sym->loc, (format("undefined symbol `%1%'") % sym->cppstr).str()); + THROW_IF(!ref, sym->loc, (format("undefined symbol `%1%'") % sym->sym()).str()); c.constrain(tenv, sym, *ref); } @@ -47,7 +47,7 @@ constrain_fn(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) (format("duplicate parameter `%1%'") % sym->str()).str()); defs.insert(sym); const AType* tvar = tenv.fresh(sym); - frame.push_back(make_pair(sym, tvar)); + frame.push_back(make_pair(sym->sym(), tvar)); protT.push_back(tvar); } protT.head->loc = call->loc; @@ -64,7 +64,7 @@ constrain_fn(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) THROW_IF(defs.count(sym) != 0, call->loc, (format("`%1%' defined twice") % sym->str()).str()); defs.insert(sym); - frame.push_back(make_pair(sym, (AType*)NULL)); + frame.push_back(make_pair(sym->sym(), (AType*)NULL)); } } @@ -190,7 +190,7 @@ constrain_cons(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) for (ATuple::const_iterator i = call->iter_at(1); i != call->end(); ++i) resp_constrain(tenv, c, *i); - if (sym->cppstr == "Tup") { + if (!strcmp(sym->sym(), "Tup")) { TList tupT(new AType(tenv.Tup, NULL, call->loc)); for (ATuple::const_iterator i = call->iter_at(1); i != call->end(); ++i) { tupT.push_back(tenv.var(*i)); @@ -199,7 +199,7 @@ constrain_cons(TEnv& tenv, Constraints& c, const ATuple* call) throw(Error) } else { const AType** consTRef = tenv.ref(sym); THROW_IF(!consTRef, call->loc, - (format("call to undefined constructor `%1%'") % sym->cppstr).str()); + (format("call to undefined constructor `%1%'") % sym->sym()).str()); const AType* consT = *consTRef; type = new AType(consT->head()->as_type(), 0, call->loc); } @@ -323,7 +323,7 @@ constrain_tuple(TEnv& tenv, Constraints& c, const ATuple* tup) throw(Error) return; } - const std::string form = sym->cppstr; + const std::string form = sym->sym(); if (is_primitive(tenv.penv, tup)) constrain_primitive(tenv, c, tup); else if (form == "fn") |