@@ -277,7 +277,8 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
277277 -- question: CAFs in where blocks?
278278 tclift $ tfail $ (At fc (NoTypeDecl n))
279279 [ty] -> return ty
280− pats_in <- mapM (elabClause info (TCGen `elem` opts)) cs
280+ pats_in <- mapM (elabClause info (TCGen `elem` opts))
281+ (zip [0..] cs)
281282 -- if the return type of 'ty' is collapsible, the optimised version should
282283 -- just do nothing
283284 ist <- get
@@ -439,14 +440,15 @@ checkPossible info fc tcgen fname lhs_in
439440-- trace (show (delab' i lhs_tm True) ++ "\n" ++ show lhs) $ return (not b)
440441 Error _ -> return False
441442
442−elabClause :: ElabInfo -> Bool -> PClause -> Idris (Either Term (Term, Term))
443−elabClause info tcgen (PClause fc fname lhs_in [] PImpossible [])
443+elabClause :: ElabInfo -> Bool -> (Int, PClause) ->
444+ Idris (Either Term (Term, Term))
445+elabClause info tcgen (_, PClause fc fname lhs_in [] PImpossible [])
444446 = do b <- checkPossible info fc tcgen fname lhs_in
445447 case b of
446448 True -> fail $ show fc ++ ":" ++ show lhs_in ++ " is a possible case"
447449 False -> do ptm <- mkPatTm lhs_in
448450 return (Left ptm)
449−elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
451+elabClause info tcgen (cnum, PClause fc fname lhs_in withs rhs_in whereblock)
450452 = do ctxt <- getContext
451453 -- Build the LHS as an "Infer", and pull out its type and
452454 -- pattern bindings
@@ -503,7 +505,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
503505 checkInferred fc (delab' i crhs True) rhs
504506 return $ Right (clhs, crhs)
505507 where
506− decorate x = UN (show x ++ "#" ++ show fname)
508+ decorate x = UN (show x ++ "#" ++ show cnum ++ "#" ++ show fname)
507509 pinfo ns ps i
508510 = let ds = concatMap declared ps
509511 newps = params info ++ ns
@@ -517,7 +519,7 @@ elabClause info tcgen (PClause fc fname lhs_in withs rhs_in whereblock)
517519 -- _ -> MN i (show n)) . l
518520 }
519521
520−elabClause info tcgen (PWith fc fname lhs_in withs wval_in withblock)
522+elabClause info tcgen (_, PWith fc fname lhs_in withs wval_in withblock)
521523 = do ctxt <- getContext
522524 -- Build the LHS as an "Infer", and pull out its type and
523525 -- pattern bindings