Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Annotation of /tests/trunk/bugs/tests.obsolete/bug416.sml
ViewVC logotype

Annotation of /tests/trunk/bugs/tests.obsolete/bug416.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 548 - (view) (download)
Original Path: sml/trunk/tests/bugs/tests/bug416.sml

1 : dbm 548 (* bug416.sml *)
2 :     (* lack of equality type checking on functor application *)
3 :    
4 :     signature PSIG =
5 :     sig
6 :     eqtype 'a symTab ;
7 :     datatype guide = G1 | G2 of guide symTab (* guide an eqtype *)
8 :     end;
9 :    
10 :     functor PFUN (structure S : sig type 'a symTab end) =
11 :     struct
12 :     open S;
13 :     datatype guide = G1 | G2 of guide symTab; (* this guide is not an eqtype *)
14 :     end;
15 :    
16 :     structure S = struct datatype 'a symTab = Empty end;
17 :     structure P = PFUN(structure S = S); (* P.guide is not an eqtype *)
18 :    
19 :     (*
20 :     P.G1 = P.G1; (* this is illegal *)
21 :     *)
22 :    
23 :     functor MFUN(structure X : PSIG) =
24 :     struct
25 :     val z = X.G1 = X.G1;
26 :     end;
27 :     structure M = MFUN(structure X = P);
28 :    
29 :     (* This functor application should be illegal because P.guide is not
30 :     an equality type as required by signature PSIG *)

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0