]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Macros3.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 / Macros3.scl
1 import "JavaBuiltin" as Java
2
3 @JavaType "java.util.Collection"
4 data Collection a
5
6 @macro
7 collectionToList :: Collection a -> [a]
8 collectionToList = Java.unsafeCoerce
9
10 singleton :: a -> Collection a
11 singleton = Java.staticMethod "java.util.Collections.singletonList"
12
13 main :: [Integer]
14 main = collectionToList (singleton 15)
15 --
16 [15]