[project @ 1998-03-11 16:49:01 by sof]
authorsof <unknown>
Wed, 11 Mar 1998 16:49:01 +0000 (16:49 +0000)
committersof <unknown>
Wed, 11 Mar 1998 16:49:01 +0000 (16:49 +0000)
newtype fix

ghc/compiler/simplCore/SimplCase.lhs

index 007221c..6417701 100644 (file)
@@ -508,10 +508,10 @@ simplAlts :: SimplEnv
 
 simplAlts env scrut (AlgAlts [] (BindDefault bndr@(id,occ_info) rhs)) rhs_c
   | maybeToBool maybe_data_ty && 
 
 simplAlts env scrut (AlgAlts [] (BindDefault bndr@(id,occ_info) rhs)) rhs_c
   | maybeToBool maybe_data_ty && 
-    not (null cons) &&         -- Not an abstract type (can arise if we're pruning tydecl imports)
-    null other_cons
-  = ASSERT( isDataTyCon tycon )
-    newIds inst_con_arg_tys    `thenSmpl` \ new_bindees ->
+    not (null cons)           && -- Not an abstract type (can arise if we're pruning tydecl imports)
+    null other_cons           &&
+    isDataTyCon tycon  -- doesn't apply to (constructor-less) newtypes
+  = newIds inst_con_arg_tys    `thenSmpl` \ new_bindees ->
     let
        new_args = [ (b, bad_occ_info) | b <- new_bindees ]
        con_app  = mkCon con ty_args (map VarArg new_bindees)
     let
        new_args = [ (b, bad_occ_info) | b <- new_bindees ]
        con_app  = mkCon con ty_args (map VarArg new_bindees)