@@ -486,14 +486,16 @@ pFixity = do pushIndent
486 istate <- getState
486 istate <- getState
487 let infixes = idris_infixes istate
487 let infixes = idris_infixes istate
488 let fs = map (Fix (f prec)) ops
488 let fs = map (Fix (f prec)) ops
489− let redecl = map (alreadyDeclared infixes) fs
489+ let redecls = map (alreadyDeclared infixes) fs
490− if False `notElem` map checkValidity redecl
490+ let ill = filter (not . checkValidity) redecls
491 then do setState (istate { idris_infixes = nub $ sort (fs ++ infixes)
492 then do setState (istate { idris_infixes = nub $ sort (fs ++ infixes)
492 , ibc_write = map IBCFix fs ++ ibc_write istate
493 , ibc_write = map IBCFix fs ++ ibc_write istate
494 fc <- pfc
495 fc <- pfc
495 return (PFix fc (f prec) ops)
496 return (PFix fc (f prec) ops)
496− else fail "Illegal redeclaration of fixity"
497+ else fail $ concatMap (\(f, (x:xs)) -> "Illegal redeclaration of fixity: \""
498+ ++ show f ++ "\" overrides \"" ++ show x ++ "\"\n") ill
497 where alreadyDeclared :: [FixDecl] -> FixDecl -> (FixDecl, [FixDecl])
499 where alreadyDeclared :: [FixDecl] -> FixDecl -> (FixDecl, [FixDecl])
498 alreadyDeclared fs f = (f, filter ((extractName f ==) . extractName) fs)
500 alreadyDeclared fs f = (f, filter ((extractName f ==) . extractName) fs)