]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/CHR9.scl
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / CHR9.scl
1 module { export = [main], features = [chr] }
2 import "StandardLibrary"
3
4 main = ()
5   where
6     constraint V { x :: Double, y :: Double } 
7     V { ?x } => print ?x
8     True => V { x = 1.0, y = 2.0 }
9 --
10 1.0
11 ()
12 --
13 module { export = [main], features = [chr] }
14 import "StandardLibrary"
15
16 main = ()
17   where
18     constraint V { x :: Double, y :: Double }
19     True => V { x = 1.0 }
20 --
21 7:13-7:26: Field y not defined.
22 --
23 module { export = [main], features = [chr] }
24
25 import "StandardLibrary"
26
27 main = ()
28   where
29     constraint V Double Double
30     True => V { x = 1.0, y = 2.0 }
31 --
32 8:13-8:35: Relation V does not define field names.
33 --
34 module { export = [main], features = [chr] }
35
36 import "StandardLibrary"
37
38 main = ()
39   where
40     True => V { x = 1.0, y = 2.0 }
41 --
42 7:13-7:35: Relation must be declared if record syntax is used.