DuplicateRecordFields + PatternSynonyms scope error in GHCi
Summary
In HEAD, when defining a record pattern synonym with DuplicateRecordFields
enabled in GHCi, the record fields do not appear to be in scope.
Steps to reproduce
GHCi, version 9.1.20201222: https://www.haskell.org/ghc/ :? for help
ghci> :set -XPatternSynonyms
ghci> pattern P{x} = [x]
ghci> :t x
x :: [a] -> a
ghci> :set -XDuplicateRecordFields
ghci> pattern Q{y} = [y]
ghci> :t y
<interactive>:1:1: error: Variable not in scope: y
Expected behavior
The y
field should be in scope in the example.
Environment
- GHC version used: HEAD (this does not occur before !4467 (closed), because previously
DuplicateRecordFields
was ignored for pattern synonyms)