[GHC] #11228: Interaction between ORF and record pattern synonyms needs to be resolved.
GHC
ghc-devs at haskell.org
Thu Dec 24 11:37:10 UTC 2015
#11228: Interaction between ORF and record pattern synonyms needs to be resolved.
-------------------------------------+-------------------------------------
Reporter: mpickering | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.11
Resolution: | Keywords:
| PatternSynonyms, orf
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #9975, #11283 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by adamgundry):
* owner: adamgundry =>
* related: #9975 => #9975, #11283
Comment:
The panic was actually caused by the combination of pattern synonyms and
`DisambiguateRecordFields` or `RecordWildCards`, without needing
`DuplicateRecordFields`. See #11283.
The more general question of the interaction of `DuplicateRecordFields`
and record pattern synonyms looks like it will be rather intricate. At the
moment, record pattern synonym constructors and fields are not
distinguished by the `Avail` or `Parent` types, but constructors and
fields will need to be handled differently. This will require significant
refactoring.
We need to track the pattern synonym to which a field belongs, so that we
can disambiguate fields properly. This doesn't even require
`DuplicateRecordFields`: merely using `DisambiguateRecordFields` fails
when the constructor is a record pattern synonym. However, the pattern
synonym isn't a "parent" for the field in the same way that a datatype is.
And pattern synonyms have the added complexity of being able to be
associated with arbitrary parent datatypes.
In addition, once `DuplicateRecordFields` is involved we need to keep
track of the `FieldLabelString` separately from the `Name` when
representing fields (e.g. in `AvailTC` or `FldParent`).
I'm not going to be able to address this in the near future.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11228#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list