# HG changeset patch # User Adam Chlipala # Date 1213306892 14400 # Node ID 535c324f0b35784784858474f0126ca7101b6856 # Parent 0ff8c27286346788afafa3dfd19a2ebfe091a3b7 Matching structures in signatures diff -r 0ff8c2728634 -r 535c324f0b35 src/elaborate.sml --- a/src/elaborate.sml Thu Jun 12 17:35:51 2008 -0400 +++ b/src/elaborate.sml Thu Jun 12 17:41:32 2008 -0400 @@ -1085,7 +1085,14 @@ end | _ => NONE) - | _ => raise Fail "Not ready for more sig matching" + | L'.SgiStr (x, n2, sgn2) => + seek (fn sgi1All as (sgi1, _) => + case sgi1 of + L'.SgiStr (x, n1, sgn1) => + (subSgn env sgn1 sgn2; + SOME env) + | _ => NONE) + (* Add type equations between structures here some day. *) end in ignore (foldl folder env sgis2) diff -r 0ff8c2728634 -r 535c324f0b35 tests/modules.lac --- a/tests/modules.lac Thu Jun 12 17:35:51 2008 -0400 +++ b/tests/modules.lac Thu Jun 12 17:41:32 2008 -0400 @@ -57,3 +57,19 @@ type s = int type t = float end + + +structure N = struct + type t = string + structure N2 = struct + type t = int + val zero = 0 + end + val x = "Hi" +end +signature N = sig + structure N2 : NAT + type t + val x : t +end +structure No : N = N