on master help sign in
Better unused argument spotting
9c0cb92Edwin Brady
src/Core/CaseTree.hs+1
@@ -136,6 +136,7 @@ findCalls sc topargs = nub $ nu' topargs sc where
136 | (P Ref n _, args) <- unApply fn
136 | (P Ref n _, args) <- unApply fn
137 = if n `elem` ps then nut ps f ++ nut ps a
137 = if n `elem` ps then nut ps f ++ nut ps a
138 else [(n, map argNames args)] ++ concatMap (nut ps) args
138 else [(n, map argNames args)] ++ concatMap (nut ps) args
139+ | (P (TCon _ _) n _, _) <- unApply fn = []
139 | otherwise = nut ps f ++ nut ps a
140 | otherwise = nut ps f ++ nut ps a
140 nut ps (Bind n (Let t v) sc) = nut ps v ++ nut (n:ps) sc
141 nut ps (Bind n (Let t v) sc) = nut ps v ++ nut (n:ps) sc
141 nut ps (Proj t _) = nut ps t
142 nut ps (Proj t _) = nut ps t
src/IRTS/Compiler.hs+2
@@ -217,6 +217,8 @@ instance ToIR (TT Name) where
217-- return (LOp LBPlus [k', LConst (BI 1)])
217-- return (LOp LBPlus [k', LConst (BI 1)])
218 | (P (DCon t a) n _, args) <- unApply tm
218 | (P (DCon t a) n _, args) <- unApply tm
219 = irCon env t a n args
219 = irCon env t a n args
220+ | (P (TCon t a) n _, args) <- unApply tm
221+ = return LNothing
220 | (P _ n _, args) <- unApply tm
222 | (P _ n _, args) <- unApply tm
221 = do i <- getIState
223 = do i <- getIState
222 args' <- mapM (ir' env) args
224 args' <- mapM (ir' env) args