summaryrefslogtreecommitdiff
path: root/tests/functorMania.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-02-20 10:27:15 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2014-02-20 10:27:15 -0500
commita36e0f809c85f4ad5cc0897a6630fb9faf809c15 (patch)
tree42e00b6f554fae7021de8f1f5b912048114253df /tests/functorMania.ur
parentf9989b616d8cf4fd1bfd968839bfdbe869468f7a (diff)
Some more nested functor bug-fixing, including generating fresh internal names at applications; still need to debug issues with datatype constructors
Diffstat (limited to 'tests/functorMania.ur')
-rw-r--r--tests/functorMania.ur36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/functorMania.ur b/tests/functorMania.ur
new file mode 100644
index 00000000..c11ff473
--- /dev/null
+++ b/tests/functorMania.ur
@@ -0,0 +1,36 @@
+functor F1(M : sig type t end) = struct
+ type t = M.t
+ fun g () : M.t = g ()
+ fun f () = g ()
+end
+functor F2(M : sig type t end) = F1(M)
+functor F3(M : sig type t end) = F2(M)
+
+functor F4(M : sig end) = F1(struct type t = int end)
+functor F5(M : sig end) = F2(struct type t = int end)
+functor F6(M : sig end) = F3(struct type t = int end)
+
+functor F7(M : sig end) = F1(struct type t = string end)
+functor F8(M : sig end) = F2(struct type t = string end)
+functor F9(M : sig end) = F3(struct type t = string end)
+
+structure M1 = F1(struct type t = string end)
+structure M2 = F2(struct type t = string end)
+structure M3 = F3(struct type t = string end)
+
+structure M4 = F4(struct end)
+structure M5 = F5(struct end)
+structure M6 = F6(struct end)
+
+structure M7 = F7(struct end)
+structure M8 = F8(struct end)
+structure M9 = F9(struct end)
+
+fun loop x : unit = loop (M1.f (), M2.f (), M3.f (),
+ M4.f (), M5.f (), M6.f (),
+ M7.f (), M8.f (), M9.f ())
+
+fun main () : transaction page =
+ x <- error <xml/>;
+ u <- return (loop x);
+ return <xml/>