Skip to content

fix: RenameCon affects case branch labels#439

Merged
mergify[bot] merged 1 commit intomainfrom
brprice/renamecon-case-branch
May 11, 2022
Merged

fix: RenameCon affects case branch labels#439
mergify[bot] merged 1 commit intomainfrom
brprice/renamecon-case-branch

Conversation

@brprice
Copy link
Copy Markdown
Contributor

@brprice brprice commented May 9, 2022

When renaming a constructor C to D, we must not only rename every
use of it as a constructor, but also where it appears as a branch label.
For example, in the code

    case x of
      C y -> (True, C 1)

there are two usages of C to rename. Previously we only changed the
C 1 and not the C y.

@brprice brprice requested a review from a team May 9, 2022 15:43
@brprice
Copy link
Copy Markdown
Contributor Author

brprice commented May 9, 2022

This was found when adding tests for #429, but I expect it has been lurking since #367.

Comment thread primer/test/Tests/Action/Prog.hs
@brprice brprice force-pushed the brprice/renamecon-case-branch branch 2 times, most recently from f080c0e to db70b29 Compare May 9, 2022 16:49
When renaming a constructor 'C' to 'D', we must not only rename every
use of it as a constructor, but also where it appears as a branch label.
For example, in the code
  case x of
    C y -> (True, C 1)
there are two usages of 'C' to rename. Previously we only changed the
'C 1' and not the 'C y'.
@brprice brprice force-pushed the brprice/renamecon-case-branch branch from db70b29 to 7ee5a8b Compare May 10, 2022 12:40
@brprice brprice added the Ready to merge Ready to merge label May 11, 2022
mergify Bot added a commit that referenced this pull request May 11, 2022
@mergify mergify Bot merged commit 66bca48 into main May 11, 2022
@mergify mergify Bot deleted the brprice/renamecon-case-branch branch May 11, 2022 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge Ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants