Add assertions
authorJan Stolarek <jan.stolarek@p.lodz.pl>
Fri, 11 Sep 2015 20:29:02 +0000 (22:29 +0200)
committerJan Stolarek <jan.stolarek@p.lodz.pl>
Fri, 11 Sep 2015 23:24:17 +0000 (01:24 +0200)
compiler/typecheck/FamInst.hs

index 49fc5fe..978e92e 100644 (file)
@@ -423,7 +423,8 @@ makeInjectivityErrors
    -> [CoAxBranch] -- ^ List of injectivity conflicts
    -> [(SDoc, SrcSpan)]
 makeInjectivityErrors tycon axiom inj conflicts
-  = let lhs             = coAxBranchLHS axiom
+  = ASSERT2( any id inj, text "No injective type variables" )
+    let lhs             = coAxBranchLHS axiom
         rhs             = coAxBranchRHS axiom
 
         are_conflicts   = not $ null conflicts