]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportJavaConstructor.scl
Automatic execution of SCL tests in Maven
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / ImportJavaConstructor.scl
diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportJavaConstructor.scl b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ImportJavaConstructor.scl
new file mode 100644 (file)
index 0000000..8c45e43
--- /dev/null
@@ -0,0 +1,18 @@
+\r
+@JavaType "org.simantics.scl.compiler.elaboration.expressions.Expression"\r
+data Expression = \r
+    @JavaType "org/simantics/scl/compiler/elaboration/expressions/EIntegerLiteral"\r
+    @FieldNames [value]\r
+    EIntegerLiteral String\r
+  | @JavaType "org.simantics.scl.compiler.elaboration.expressions.ERealLiteral"\r
+    @FieldNames [value]\r
+    ERealLiteral String\r
+\r
+changeType :: Expression -> Expression\r
+changeType (EIntegerLiteral value) = ERealLiteral value\r
+changeType (ERealLiteral value) = EIntegerLiteral value\r
+\r
+main :: Expression\r
+main = changeType (EIntegerLiteral "123") \r
+--\r
+123
\ No newline at end of file