X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FCHR9.scl;fp=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FCHR9.scl;h=07514821a38342bc720b20a17aa6c58e2753794d;hp=0000000000000000000000000000000000000000;hb=6d233d1b05176e40f634766537082d2a2ec65fd0;hpb=9a17c7c202c7104631fa5d899a4583a0cc2ad6ac diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR9.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR9.scl new file mode 100644 index 000000000..07514821a --- /dev/null +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR9.scl @@ -0,0 +1,42 @@ +module { export = [main], chr } +import "StandardLibrary" + +main = () + where + constraint V { x :: Double, y :: Double } + V { ?x } => print ?x + True => V { x = 1.0, y = 2.0 } +-- +1.0 +() +-- +module { export = [main], chr } +import "StandardLibrary" + +main = () + where + constraint V { x :: Double, y :: Double } + True => V { x = 1.0 } +-- +7:13-7:26: Field y not defined. +-- +module { export = [main], chr } + +import "StandardLibrary" + +main = () + where + constraint V Double Double + True => V { x = 1.0, y = 2.0 } +-- +8:13-8:35: Relation V does not define field names. +-- +module { export = [main], chr } + +import "StandardLibrary" + +main = () + where + True => V { x = 1.0, y = 2.0 } +-- +7:13-7:35: Relation must be declared if record syntax is used. \ No newline at end of file