]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR10.scl
(refs #7250) Support for record syntax for CHR relations
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / CHR10.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR10.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR10.scl
new file mode 100644 (file)
index 0000000..758074d
--- /dev/null
@@ -0,0 +1,30 @@
+module { export = [main], chr }
+import "StandardLibrary"
+
+data V = V { x :: Double, y :: Double }
+
+main = ()
+  where
+    constraint X V 
+    X V { ?x } => print ?x
+    X V { ?y } => print ?y
+    True => X V { x = 1.0, y = 2.0 }
+    True => X V { x = 3.0, y = 4.0 }
+--
+1.0
+2.0
+3.0
+4.0
+()
+--
+module { export = [main], chr }
+import "StandardLibrary"
+
+data V = V { x :: Double, y :: Double }
+
+main = ()
+  where
+    constraint X V 
+    True => X V { x = 1.0 }
+--
+9:15-9:28: Field y not defined.
\ No newline at end of file