[Bug][CLI]: Match does not narrow based on length
Describe the Bug
https://pyrefly.org/sandbox/?code=MQAg6gpgNgxg9gWwiALnVALZAFAngJwgDMpcQBlAQwDsATAIzgA8AaTASwGcQuRKQADpQDmEAFCgA7lkIhccAK4gYNEJPzsUENpwyVZNWiCgR91PowUpUuAe2rCe5vCgxxqAOgkSQACQgGBsqKAiYgRKYoCoTccEQc3JyGjEwAXD4AtCAA4hDWhJRQGSjsSDYCyDBYMADW9o4REAyUtZkgAKqcyIQAbqZQAPoothAAFACUqOj2nBUw1vYR+IRGwxWcbRBMFRpI1NaSmhiYyACSACIAouGR0RDcrpQHyJwKAgJw+NajEB7CHnwrHB4AhQnltCBhHBitDaMR7Jp2O42G4+vg2HkYOM2mANFo+HQQPgFM5cK53ME4SBaOxCPNSE45Ip8CB6Pg4JIuvgxER2QhyvUeKDPvkIH1CkMRmI4fEtJwUKM0qg3iYANr2FAAXRAAB9lWD1fs2BrNeN0iALSAEE8qiA0mJLY7lJQuiBVUR5ZrzU6fb1+pKKorsT6fQ6Q0A
Codebase
No response
Other Attempts
No response
There are two kinds we need to handle:
- concrete pattern = exclude tuples that can;t be exactly this length
- unbounded patterns = exclude tuples that have < n-1 elements
This is fixed and there's a regression test in the codebase.
https://github.com/facebook/pyrefly/blob/a92962ad0cdc819d5567dbf34b226309e259a6ef/pyrefly/lib/test/flow.rs#L827-L840
Hurrah!