Skip to content

Code fix to adjust n-tuples #15414

Description

@psfinaki

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions