newtype fixes, coercions for non-recursive newtypes now optional
[ghc-hetmet.git] / compiler / main / HscTypes.lhs
index 26d6fab..2c8780c 100644 (file)
@@ -640,8 +640,9 @@ implicitTyThings (AClass cl) = map AnId (classSelIds cl) ++
 implicitTyThings (ADataCon dc) = map AnId (dataConImplicitIds dc)
 
        -- For newtypes, add the implicit coercion tycon
-implicitNewCoTyCon tc | isNewTyCon tc = [ATyCon (newTyConCo tc)]
-                     | otherwise     = []
+implicitNewCoTyCon tc 
+  | isNewTyCon tc, Just co_con <- newTyConCo tc = [ATyCon co_con]
+  | otherwise = []
 
 extras_plus thing = thing : implicitTyThings thing