]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/GenericMutualRecursion.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / GenericMutualRecursion.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/GenericMutualRecursion.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/GenericMutualRecursion.scl
new file mode 100644 (file)
index 0000000..24c5858
--- /dev/null
@@ -0,0 +1,12 @@
+// Idea of this test is to ensure that generic type variables\r
+// and constraints are handled correctly with mutually recursive\r
+// functions\r
+\r
+import "Prelude"\r
+\r
+deepId count x = deepId2 count x\r
+deepId2 count x = if count <= 0 then x else deepId (count-1) x\r
+\r
+main = deepId 5 "FOO"\r
+--\r
+FOO
\ No newline at end of file