Debian Codegraph @

lang/interpret_test/TestAstFunc2/test-one-instance-class-arg.txtar

raw
1 -- CONFIG --
2 {
3 "maximum-count": 1
4 }
5 -- main.mcl --
6 import "test"
7
8 class use_twice($test1, $test2, $x) {
9 test "${test1}" {
10 anotherstr => $x,
11 }
12 test "${test2}" {
13 anotherstr => $x,
14 }
15 }
16
17 # one_instance_e should only produce one value, and will error if initialized twice
18 include use_twice("test1", "test2", test.one_instance_e())
19
20 # one_instance_f should only produce one value, and will error if initialized twice
21 include use_twice("test3", "test4", test.one_instance_f())
22 -- OUTPUT --
23 Vertex: test[test1]
24 Vertex: test[test2]
25 Vertex: test[test3]
26 Vertex: test[test4]