diff options
Diffstat (limited to 'typing.cpp')
-rw-r--r-- | typing.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -150,9 +150,9 @@ void ADefinition::constrain(TEnv& tenv, Constraints& c) const { if (size() != 3) throw Error("`def' requires exactly 2 arguments", loc); - const ASymbol* sym = at(1)->to<const ASymbol*>(); - if (!sym) - throw Error("`def' name is not a symbol", loc); + const ASymbol* sym = this->sym(); + if (!sym) throw Error("`def' has no symbol", loc); + AType* tvar = tenv.var(at(2)); tenv.def(sym, make_pair(at(2), tvar)); at(2)->constrain(tenv, c); |