Incorrect diagnostic for illegal record syntax when the field is used
Prelude> data F a = F a { f :: a }; t = F { f = 'c' }
<interactive>:1:36: error: Not in scope: ‘f’
Expected behavior
• Record syntax is illegal here: {f :: a}
• In the type ‘{f :: a}’
In the definition of data constructor ‘F’
In the data declaration for ‘F’
What is interesting, is that this is a parser error that gets masked by some "in scope" error. Should this not already be rejected by the parser?
- GHC version used: 8.6.1 and HEAD