Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code fix to adjust n-tuples #15414

Open
Tracked by #15408
psfinaki opened this issue Jun 15, 2023 · 0 comments
Open
Tracked by #15408

Code fix to adjust n-tuples #15414

psfinaki opened this issue Jun 15, 2023 · 0 comments
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Feature Request
Milestone

Comments

@psfinaki
Copy link
Member

psfinaki commented Jun 15, 2023

Originally suggested by @T-Gro

When pattern matching a DU member on a big n-tuple (e.g. 5 items) and n decreases because of a change - you get a type mismatch because a 5-tuple does not work with a 6-tuple.

The codefix could:

  • Add one more " , _ ,"
  • BETTER: suggest to convert the DU member matching from positional arguments to named ones.
    • Precondition: The items of the DU member have real names, and not just Item1..ItemN
      • All the discarded _ ones can be ignored
      • Only the really used ones remain

This would react on: FS0727 - This union case expects %i arguments

@github-actions github-actions bot added this to the Backlog milestone Jun 15, 2023
@psfinaki psfinaki mentioned this issue Jun 15, 2023
85 tasks
@0101 0101 removed the Needs-Triage label Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-LangService-CodeFixes Code fixes associated with diagnostics Feature Request
Projects
Status: New
Development

No branches or pull requests

2 participants