Panic properly if wrongKindOfFamily is given an unexpected family
authorIan Lynagh <igloo@earth.li>
Fri, 4 May 2007 22:18:57 +0000 (22:18 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 4 May 2007 22:18:57 +0000 (22:18 +0000)
Used to just give a "Non-exhaustive patterns" failure

compiler/typecheck/TcTyClsDecls.lhs

index dbf83fb..76b9a9e 100644 (file)
@@ -1197,6 +1197,7 @@ wrongKindOfFamily family =
     kindOfFamily | isSynTyCon  family = ptext SLIT("type synonym")
                 | isDataTyCon family = ptext SLIT("data type")
                 | isNewTyCon  family = ptext SLIT("newtype")
+                | otherwise = pprPanic "wrongKindOfFamily" (ppr family)
 
 emptyConDeclsErr tycon
   = sep [quotes (ppr tycon) <+> ptext SLIT("has no constructors"),