X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=tests%2Forg.simantics.scl.compiler.tests%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Ftests%2Fscl%2FImportJavaConstructor.scl;h=f1db2850c48042bb930ede9f451fa1690a5b483c;hp=8c45e438b101955fe24a496f324f545707219e66;hb=172abed5dbf73c1304a7a95bb8504ea293556948;hpb=bb5a3edf299cb943999c72c69dd68fb740c8a506 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 index 8c45e438b..f1db2850c 100644 --- 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 @@ -1,18 +1,18 @@ - -@JavaType "org.simantics.scl.compiler.elaboration.expressions.Expression" -data Expression = - @JavaType "org/simantics/scl/compiler/elaboration/expressions/EIntegerLiteral" - @FieldNames [value] - EIntegerLiteral String - | @JavaType "org.simantics.scl.compiler.elaboration.expressions.ERealLiteral" - @FieldNames [value] - ERealLiteral String - -changeType :: Expression -> Expression -changeType (EIntegerLiteral value) = ERealLiteral value -changeType (ERealLiteral value) = EIntegerLiteral value - -main :: Expression -main = changeType (EIntegerLiteral "123") --- + +@JavaType "org.simantics.scl.compiler.elaboration.expressions.Expression" +data Expression = + @JavaType "org/simantics/scl/compiler/elaboration/expressions/EIntegerLiteral" + @FieldNames [value] + EIntegerLiteral String + | @JavaType "org.simantics.scl.compiler.elaboration.expressions.ERealLiteral" + @FieldNames [value] + ERealLiteral String + +changeType :: Expression -> Expression +changeType (EIntegerLiteral value) = ERealLiteral value +changeType (ERealLiteral value) = EIntegerLiteral value + +main :: Expression +main = changeType (EIntegerLiteral "123") +-- 123 \ No newline at end of file