diff options
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index 0c9951c..b7d7a0d 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -173,6 +173,18 @@ AIf::constrain(TEnv& tenv, Constraints& c) const } void +ACons::constrain(TEnv& tenv, Constraints& c) const +{ + AType* type = tup<AType>(loc, tenv.Tup, 0); + for (const_iterator i = begin() + 1; i != end(); ++i) { + (*i)->constrain(tenv, c); + type->push_back(tenv.var(*i)); + } + + c.constrain(tenv, this, type); +} + +void APrimitive::constrain(TEnv& tenv, Constraints& c) const { const string n = head()->to<const ASymbol*>()->str(); |