Special-case record fields ending with hash when deriving Read
ClosedPublic

Authored by RyanGlScott on Mar 14 2018, 9:52 AM.

Details

Summary

In commit dbd81f7e86514498218572b9d978373b1699cc5b, a
regression was inadvertently introduced which caused derived Read
instances for record data types with fields ending in a # symbol
(using MagicHash) would no longer parse on valid output. This
is ultimately due to the same reasons as Trac #5041, as we cannot parse
a field name like foo# as a single identifier. We fix this issue
by employing the same workaround as in Trac #5041: first parse the
identifier name foo, then then symbol #.

This is accomplished by the new readFieldHash function in
GHC.Read. This will likely warrant a base-4.11.1.0 release.

Test Plan

make test TEST=T14918

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
RyanGlScott created this revision.Mar 14 2018, 9:52 AM
RyanGlScott added inline comments.Mar 14 2018, 9:59 AM
docs/users_guide/index.rst
14–16

Do you think the 8.2.1-notes and the 8.4.1-notes should be removed from here, now that 8.4.2 and 8.6.1 are in progress?

  • The Main event
bgamari added inline comments.Mar 19 2018, 12:02 PM
docs/users_guide/index.rst
14–16

Yes, I suppose we should remove them.

  • Delete 8.2.1- and 8.4.1-notes from users_guide/index.rst
RyanGlScott marked 2 inline comments as done.Mar 19 2018, 12:07 PM
RyanGlScott added inline comments.
docs/users_guide/index.rst
14–16

Done.

bgamari accepted this revision.Mar 23 2018, 10:32 AM

Yes, this looks right to me.

This revision is now accepted and ready to land.Mar 23 2018, 10:32 AM
This revision was automatically updated to reflect the committed changes.
RyanGlScott marked an inline comment as done.