Skip to content

Fix for custom deprecations in record wild cards

This MR fixes the ticket #23382 (closed). Before, deprecations were not emitted whenever a record field was used through record wild cards. This was to prevent noise from record fields that were not used in the RHS. Now, a deprecation will only be emitted if the implicit variable to which the record field is used in the RHS. For example:

module A where
data Foo = Foo {x :: Int, y :: Bool, z :: Char}

{-# DEPRECATED x "x" #-}
{-# WARNING y "y" #-}
module B where
import A

foo (Foo {..}) = x -- only x is deprecated here
Edited by Bartłomiej Cieślar

Merge request reports