Skip to content

WARN pragma gives warning `warning: [-Wdeprecations]'

Example:

-- Warn.hs

module Warn where

__todo :: String -> a
{-# WARNING __todo "TODO" #-}
__todo msg = error $ "TODO: " ++ msg
-- Main.hs

{- OPTIONS_GHC -Wall #-}

import Warn

inc :: Int -> Int
inc n | n >= 0 = n + 1
inc _ = __todo "what about negatives?"

When compile the files (or ghci), I get

UseWarn.hs:9:9: warning: [-Wdeprecations]
    In the use of ‘__todo’ (imported from Warn): "TODO"

Should the flag be -Wwarnings-deprecations? And -Wdeprecations is not in the user guide, if it is a genuine flag.

Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure IncorrectWarning
Priority low
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Linux
Architecture x86_64 (amd64)
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information