[commit: ghc] master: Add assertions (8c0eca3)

git at git.haskell.org git at git.haskell.org
Fri Sep 11 23:22:40 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/8c0eca3dccd58b41b226d3f3aad9a02a18bef6de/ghc

>---------------------------------------------------------------

commit 8c0eca3dccd58b41b226d3f3aad9a02a18bef6de
Author: Jan Stolarek <jan.stolarek at p.lodz.pl>
Date:   Fri Sep 11 22:29:02 2015 +0200

    Add assertions


>---------------------------------------------------------------

8c0eca3dccd58b41b226d3f3aad9a02a18bef6de
 compiler/typecheck/FamInst.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/FamInst.hs b/compiler/typecheck/FamInst.hs
index 49fc5fe..978e92e 100644
--- a/compiler/typecheck/FamInst.hs
+++ b/compiler/typecheck/FamInst.hs
@@ -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



More information about the ghc-commits mailing list