[m-rev.] diff: classify_type_ctor on builtin types

Peter Wang novalazy at gmail.com
Thu Apr 23 15:58:10 AEST 2009


Branches: main

compiler/type_util.m:
        Make `classify_type_ctor' handle some builtin types.  Without this
        the Java backend aborted when trying to compile builtin.m.

diff --git a/compiler/type_util.m b/compiler/type_util.m
index a8f4e93..43e8d8c 100644
--- a/compiler/type_util.m
+++ b/compiler/type_util.m
@@ -713,6 +713,25 @@ classify_type_ctor(ModuleInfo, TypeCtor) = TypeCategory :-
         TypeCategory = TypeCategoryPrime
     ;
         TypeSymName = qualified(ModuleSymName, TypeName),
+        ModuleSymName = mercury_public_builtin_module,
+        Arity = 0,
+        (
+            TypeName = "pred",
+            TypeCategoryPrime = ctor_cat_higher_order
+        ;
+            TypeName = "func",
+            TypeCategoryPrime = ctor_cat_higher_order
+        ;
+            TypeName = "tuple",
+            TypeCategoryPrime = ctor_cat_tuple
+        ;
+            TypeName = "void",
+            TypeCategoryPrime = ctor_cat_void
+        )
+    ->
+        TypeCategory = TypeCategoryPrime
+    ;
+        TypeSymName = qualified(ModuleSymName, TypeName),
         ModuleSymName = mercury_private_builtin_module,
         Arity = 0,
         (
--------------------------------------------------------------------------
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