Skip to content
  • Sebastian Graf's avatar
    Fix long distance info for record updates · f3e737bb
    Sebastian Graf authored and Marge Bot's avatar Marge Bot committed
    For record updates where the `record_expr` is a variable, as in #17783:
    
    ```hs
    data PartialRec = No
                    | Yes { a :: Int, b :: Bool }
    update No = No
    update r@(Yes {}) = r { b = False }
    ```
    
    We should make use of long distance info in
    `-Wincomplete-record-updates` checking. But the call to `matchWrapper`
    in the `RecUpd` case didn't specify a scrutinee expression, which would
    correspond to the `record_expr` `r` here. That is fixed now.
    
    Fixes #17783.
    f3e737bb