[MLton-commit] r7433

Matthew Fluet fluet at mlton.org
Fri Mar 12 13:33:04 PST 2010


Additional withtype regression tests.
----------------------------------------------------------------------

A   mlton/trunk/regression/withtype2.sml
A   mlton/trunk/regression/withtype3.sml
A   mlton/trunk/regression/withtype4.sml
A   mlton/trunk/regression/withtype5.sml

----------------------------------------------------------------------

Added: mlton/trunk/regression/withtype2.sml
===================================================================
--- mlton/trunk/regression/withtype2.sml	2010-03-12 21:33:01 UTC (rev 7432)
+++ mlton/trunk/regression/withtype2.sml	2010-03-12 21:33:03 UTC (rev 7433)
@@ -0,0 +1,17 @@
+(* withtype2.sml *)
+
+(* Checks scoping rules of withtype *)
+
+type u = real
+
+datatype t = A of v | B of u
+withtype u = int
+and v = u
+
+val a = A 1.0
+val b = B 1
+
+val x : v = 1.0
+val y : u = 1
+
+fun uEq (a: u, b: u) = a = b

Added: mlton/trunk/regression/withtype3.sml
===================================================================
--- mlton/trunk/regression/withtype3.sml	2010-03-12 21:33:01 UTC (rev 7432)
+++ mlton/trunk/regression/withtype3.sml	2010-03-12 21:33:03 UTC (rev 7433)
@@ -0,0 +1,16 @@
+(* withtype3.sml *)
+
+(* Checks scoping rules of withtype *)
+
+type u = real
+
+datatype t = T of u * v
+withtype u = int
+and v = u
+
+val z = T (1, 1.0)
+
+val x : v = 1.0
+val y : u = 1
+
+fun uEq (a: u, b: u) = a = b

Added: mlton/trunk/regression/withtype4.sml
===================================================================
--- mlton/trunk/regression/withtype4.sml	2010-03-12 21:33:01 UTC (rev 7432)
+++ mlton/trunk/regression/withtype4.sml	2010-03-12 21:33:03 UTC (rev 7433)
@@ -0,0 +1,13 @@
+(* withtype4.sml *)
+
+(* Checks scoping rules of withtype *)
+
+type u = real
+
+datatype t = T of u * v
+withtype u = int
+and      v = u
+
+val x = T(1, 1.0);
+
+fun uEq (a: u, b: u) = a = b

Added: mlton/trunk/regression/withtype5.sml
===================================================================
--- mlton/trunk/regression/withtype5.sml	2010-03-12 21:33:01 UTC (rev 7432)
+++ mlton/trunk/regression/withtype5.sml	2010-03-12 21:33:03 UTC (rev 7433)
@@ -0,0 +1,17 @@
+(* withtype.sml *)
+
+(* Checks scoping rules of withtype *)
+
+type u = int
+
+datatype t = T of u * v
+withtype u = bool
+and      v = u
+
+val z = T(true, 6)
+val y : u = true
+val x : v = 1
+
+fun tEq (a: t, b: t) = a = b
+fun uEq (a: u, b: u) = a = b
+fun vEq (a: v, b: v) = a = b




More information about the MLton-commit mailing list