- -----------
- tc_inl [] = return poly_id
- tc_inl (L loc (InlineSig _ prag) : other_inls)
- = do { unless (null other_inls) (setSrcSpan loc warn_dup_inline)
- ; return (poly_id `setInlinePragma` prag) }
- tc_inl _ = panic "tc_inl"
-
-{- Earlier we tried to warn about
- (a) INLINE for recursive function
- (b) INLINE for function that is part of a multi-binder group
- Code fragments below. But we want to allow
- {-# INLINE f #-}
- f x = x : g y
- g y = ....f...f....
- even though they are mutually recursive.
- So I'm just omitting the warnings for now
-
- | multi_bind && isInlinePragma prag
- = do { setSrcSpan loc $ addWarnTc multi_bind_warn
- ; return poly_id }
- | otherwise
- ; when (isInlinePragma prag && isRec rec_group)
- (setSrcSpan loc (addWarnTc rec_inline_warn))
-
- rec_inline_warn = ptext (sLit "INLINE pragma for recursive binder")
- <+> quotes (ppr poly_id) <+> ptext (sLit "may be discarded")
-
- multi_bind_warn = hang (ptext (sLit "Discarding INLINE pragma for") <+> quotes (ppr poly_id))
- 2 (ptext (sLit "because it is bound by a pattern, or mutual recursion") )
--}
-
-
-warnPrags :: Id -> [LSig Name] -> SDoc -> TcM ()
-warnPrags id bad_sigs herald
- = addWarnTc (hang (herald <+> quotes (ppr id))
- 2 (ppr_sigs bad_sigs))
- where
- ppr_sigs sigs = vcat (map (ppr . getLoc) sigs)