aboutsummaryrefslogtreecommitdiff
path: root/Sil/Types.icl
diff options
context:
space:
mode:
Diffstat (limited to 'Sil/Types.icl')
-rw-r--r--Sil/Types.icl6
1 files changed, 5 insertions, 1 deletions
diff --git a/Sil/Types.icl b/Sil/Types.icl
index 55e1cc0..b2009dd 100644
--- a/Sil/Types.icl
+++ b/Sil/Types.icl
@@ -36,6 +36,8 @@ where
instance toString TypeError
where
toString (IllegalApplication ft et) = "Cannot apply a " <+ et <+ " to a " <+ ft <+ "."
+ toString (IllegalField f t) = "Illegal field '" <+ f <+ "' on type " <+ t <+ "."
+ toString (TooHighTupleArity i) = "Too high tuple arity " <+ i <+ " (maximum is 32)."
instance zero TypeSize where zero = {asize=0, bsize=0, btypes=[]}
@@ -88,7 +90,9 @@ where
( top >>= \top ->
te1 >>= \te1 ->
te2 >>= \te2 -> foldM tryApply top [te1,te2])
- type res (Tuple n es) =
+ type res (Tuple n es)
+ | n > 32 = Just $ Error $ TooHighTupleArity n
+ | otherwise =
mapM (type res) es >>= \ats -> pure (sequence ats >>= pure o TTuple n)
type res (Field f e)
| isTuple = type res e >>= \te -> pure (te >>= \te -> case te of