- added new reserved word ('constructor')
- added new datatype DeprEntity to distinguish between different deprecated entities
- WarningTxt type, namely DeprecatedTxt constructor was extended with a field of type DeprEntity
- during the renaming phase, in warnIfDeprecated we do extra check for the deprecated entity
- check is performed against DeprEntity and Namespace
had to make changes in submodules:
- utils/haddock - DeprecatedTxt is used by parseWarning function
- utils/hsc2hs - CrossCodegen.hs had some binding with a name 'constructor'
few notes:
- right now the implementation feels a bit hacky - we are abusing the type (which is only responsible for the textual representation of deprecation) to carry some extra information around. Perhaps there is a better place/way or maybe WarningTxt needs just to be renamed?
- I am not sure I am happy with the entitySpecified naming. It doesn't feel right.
- if we specify deprecated entity for something non-type or non-constructor(for example, a function), ghc will ignore it and warn anyway
- when specifying several entities in one pragma, the sort of deprecated entity we've specified will apply to all listed entities
this will work - warn when these types are used(but not their constructors):
{-# DEPRECATED type Qux, Quux "Don't use this" #-}
this will not work:
{-# DEPRECATED type Qux, constructor Quux "Don't use this" #-}