]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/Throw1.scl
(refs #7567) Added throw function to builtins
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / Throw1.scl
1 import "Prelude"
2
3 importJava "java.lang.Exception" where
4     @JavaName "<init>"
5     createException :: String -> <Proc> Exception
6
7 main = throw (createException "Foo") `catch` \(e :: Exception) -> print e
8 --
9 java.lang.Exception: Foo
10 ()