]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/DefaultMethods1.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / org / simantics / scl / compiler / tests / scl / DefaultMethods1.scl
diff --git a/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/DefaultMethods1.scl b/bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/DefaultMethods1.scl
new file mode 100644 (file)
index 0000000..142dd30
--- /dev/null
@@ -0,0 +1,13 @@
+import "JavaBuiltin" as Java\r
+\r
+class Ord a where\r
+    (<) :: a -> a -> Boolean\r
+    min :: a -> a -> a\r
+    min x y = if x < y then x else y\r
+    \r
+instance Ord Integer where\r
+    (<) = Java.icmplt\r
+\r
+main = min (43 :: Integer) (69 :: Integer) \r
+--\r
+43
\ No newline at end of file