dotnet / dotnet/fsharp

Code fix to adjust n-tuples

Open
#15,414 0 comments 0 reactions 0 assignees View on GitHub
Area-LangService-CodeFixes Feature Request
Dominant language
F#
Stars
4.3k
Forks
876
Avg merge
4d 11h
Merged PRs (30d)
131

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.