Record full FieldLabel in ifConFields.
ClosedPublic

Authored by ezyang on Feb 22 2017, 10:49 PM.

Details

Summary

The previous implementation tried to be "efficient" by
storing field names once in IfaceConDecls, and only just
enough information for us to reconstruct the FieldLabel.
But this came at a bit of code complexity cost.

This patch undos the optimization, instead storing a full
FieldLabel at each data constructor. Consequently, this fixes
bugs Trac #12699 and Trac #13250.

Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>

Test Plan

validate

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.
ezyang created this revision.Feb 22 2017, 10:49 PM
ezyang updated this revision to Diff 11241.Feb 22 2017, 11:53 PM

warning squash

adamgundry edited edge metadata.Feb 23 2017, 2:39 AM

Thanks for this! I agree that it makes sense to do away with the premature "optimization" here.

compiler/iface/IfaceSyn.hs
212

Do we actually need the boolean any more? As far as I can see, it was needed only for ifaceConDeclFields, which has now gone away.

ezyang added inline comments.Feb 23 2017, 3:50 AM
compiler/iface/IfaceSyn.hs
212

You're right! Nice catch.

ezyang updated this revision to Diff 11246.Feb 23 2017, 3:57 AM

remove Bool

This revision was automatically updated to reflect the committed changes.