]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/PolymorphicRecursion.scl
(refs #7307) Added features field to SCL module header
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / PolymorphicRecursion.scl
index ed84193b7f62339402e9499424e56622a7d3c8c2..b37ff02831ef35ba300c79e29de23a40963ae014 100644 (file)
@@ -1,16 +1,16 @@
-// Idea here is to test the following property:\r
-// When a function is called recursively it has locally a monomorphic type.\r
-// Therefore the definition of cons does not work even if it works\r
-// with a proper type annotation.\r
-\r
-data Vec a = Nil | Zero (Vec (a,a)) | One a (Vec (a,a))\r
-\r
-// cons :: a -> Vec a -> Vec a\r
-cons x Nil        = One x Nil\r
-cons x (Zero ps)  = One x ps\r
-cons x (One y ps) = Zero (cons (x, y) ps)\r
---\r
-11:21-11:42: Expected <Vec (a, a)> got <Vec a>.\r
-11:33-11:34: Type (a, a) is not a subtype of a.\r
-11:36-11:37: Type (a, a) is not a subtype of a.\r
+// Idea here is to test the following property:
+// When a function is called recursively it has locally a monomorphic type.
+// Therefore the definition of cons does not work even if it works
+// with a proper type annotation.
+
+data Vec a = Nil | Zero (Vec (a,a)) | One a (Vec (a,a))
+
+// cons :: a -> Vec a -> Vec a
+cons x Nil        = One x Nil
+cons x (Zero ps)  = One x ps
+cons x (One y ps) = Zero (cons (x, y) ps)
+--
+11:21-11:42: Expected <Vec (a, a)> got <Vec a>.
+11:33-11:34: Type (a, a) is not a subtype of a.
+11:36-11:37: Type (a, a) is not a subtype of a.
 11:39-11:41: Expected <Vec a> got <Vec (a, a)>.
\ No newline at end of file