Skip to content

Fix long distance info for record updates

Sebastian Graf requested to merge wip/T17783 into master

For record updates where the record_expr is a variable, as in #17783 (closed):

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 (closed).

Edited by Sebastian Graf

Merge request reports