diff options
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index b9ce471..bd43b8e 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -100,11 +100,11 @@ AFn::constrain(TEnv& tenv, Constraints& c) const throw(Error) const AST* exp = *i; const ADef* def = exp->to<const ADef*>(); if (def) { - const ASymbol* sym = def->sym(); + const ASymbol* sym = def->list_ref(1)->as<const ASymbol*>(); THROW_IF(defs.count(sym) != 0, def->loc, (format("`%1%' defined twice") % sym->str()).str()); - defs.insert(def->sym()); - frame.push_back(make_pair(def->sym(), (AType*)NULL)); + defs.insert(sym); + frame.push_back(make_pair(sym, (AType*)NULL)); } } @@ -156,7 +156,7 @@ void ADef::constrain(TEnv& tenv, Constraints& c) const throw(Error) { THROW_IF(list_len() != 3, loc, "`def' requires exactly 2 arguments"); - const ASymbol* sym = this->sym(); + const ASymbol* sym = this->list_ref(1)->as<const ASymbol*>(); THROW_IF(!sym, loc, "`def' has no symbol") const AType* tvar = tenv.var(body()); |