aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/elaborate.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-06-19 17:55:36 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-06-19 17:55:36 -0400
commit1b40fa5b67b61def339a082bfc325ce11c8f5d19 (patch)
tree3fe43b01e654ea1b07d766ffeca39ddfd9f2fca1 /src/elaborate.sml
parent6924bb5d394ee9cbdf7dbf376c45a4ee04383c5c (diff)
Corifying functors
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r--src/elaborate.sml10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 73cf185d..d87fadd1 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -1015,6 +1015,7 @@ fun sgnError env err =
datatype str_error =
UnboundStr of ErrorMsg.span * string
| NotFunctor of L'.sgn
+ | FunctorRebind of ErrorMsg.span
fun strError env err =
case err of
@@ -1023,6 +1024,8 @@ fun strError env err =
| NotFunctor sgn =>
(ErrorMsg.errorAt (#2 sgn) "Application of non-functor";
eprefaces' [("Signature", p_sgn env sgn)])
+ | FunctorRebind loc =>
+ ErrorMsg.errorAt loc "Attempt to rebind functor"
val hnormSgn = E.hnormSgn
@@ -1391,6 +1394,13 @@ fun elabDecl ((d, loc), env) =
val (env', n) = E.pushStrNamed env x sgn'
in
+ case #1 (hnormSgn env sgn') of
+ L'.SgnFun _ =>
+ (case #1 str' of
+ L'.StrFun _ => ()
+ | _ => strError env (FunctorRebind loc))
+ | _ => ();
+
((L'.DStr (x, n, sgn', str'), loc), env')
end
end