[m-rev.] diff: void assignments on java backend

Peter Wang novalazy at gmail.com
Thu Jul 23 11:27:32 AEST 2009


Branches: main

compiler/mlds_to_java.m:
        Initialise variables of type `builtin.void' with `null' not `0'.

diff --git a/compiler/mlds_to_java.m b/compiler/mlds_to_java.m
index b69a97e..e0c162c 100644
--- a/compiler/mlds_to_java.m
+++ b/compiler/mlds_to_java.m
@@ -1549,7 +1549,6 @@ get_java_type_initializer(Type) = Initializer :-
             ( CtorCat = ctor_cat_builtin(cat_builtin_int)
             ; CtorCat = ctor_cat_builtin(cat_builtin_char)
             ; CtorCat = ctor_cat_builtin(cat_builtin_float)
-            ; CtorCat = ctor_cat_void
             ),
             Initializer = "0"
         ;
@@ -1560,6 +1559,7 @@ get_java_type_initializer(Type) = Initializer :-
             ; CtorCat = ctor_cat_enum(_)
             ; CtorCat = ctor_cat_builtin_dummy
             ; CtorCat = ctor_cat_variable
+            ; CtorCat = ctor_cat_void
             ; CtorCat = ctor_cat_user(_)
             ),
             Initializer = "null"

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list