X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FSafeDynamic1.scl;fp=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FSafeDynamic1.scl;h=f18fd7b686f0a6313dc4f0de4987fa3a6f7919b4;hb=015e75fa0a04ef370eaff4980cd34cf4bbc0b733;hp=0000000000000000000000000000000000000000;hpb=5d9fc12394233b008d38f43105d971a6ab8dfae6;p=simantics%2Fplatform.git diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SafeDynamic1.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SafeDynamic1.scl new file mode 100644 index 000000000..f18fd7b68 --- /dev/null +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/SafeDynamic1.scl @@ -0,0 +1,17 @@ +import "Prelude" +import "SafeDynamic" + +a = toSafeDynamic (1 :: Double) +b = toSafeDynamic (2 :: Integer) + +main = do + print (fromSafeDynamic a :: Maybe Double) + print (fromSafeDynamic a :: Maybe Integer) + print (fromSafeDynamic b :: Maybe Double) + print (fromSafeDynamic b :: Maybe Integer) +---- +Just 1.0 +Nothing +Nothing +Just 2 +() \ No newline at end of file