Skip to content

Code fix to adjust n-tuples #15414

@psfinaki

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions