-
Notifications
You must be signed in to change notification settings - Fork 15
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
Add "any" option to tuple matching #8
Comments
This work is currently on hold due to "discards" being added to C# 7 (see Proposed changes for deconstruction, declaration expressions, and discards, which could affect the way this feature would work. |
Discards are happening in C# 7. This would have the unfortunate affect of any static import of the So I shall change the |
* Moved Either<,> to Unions, where it should have been in the first place. Treating this as a non-breaking change as it's an undocumented partial addition to v2.2.0. * Changed the way "any" matches are constructed for tuples. This now relies on parameters of With and Or being Either<T,Any> and the Either<,> type supporting implicit conversions from T and Any to Either<T,Any>. This removed the need to add just shy of 100 new methods to the three matcher classes used by tuple matching, plus to the interfaces and 25 or so to the tuple creation class etc. * As mentioned above, the Either<T1,T2> type now supports implicit conversions from T1 and T2. Added a bunch more tests for "nay matching" on tuples. This feature now appears to be complete.
v2.3.0 released. |
Currently, if we have a tuple,
(x, y)
, which we want to match on, and we are only interested in testingx
, aWhere
must be used:Add support for an
Any
type (which exposes a value singleton,_
), that can be used withWith
:The text was updated successfully, but these errors were encountered: