jamesbascle / OneOf

Easy to use F#-like discriminated unions for C#
http://10printhello.com/oneof-npotw-2-of-n/
MIT License
3 stars 1 forks source link

Allow TypeParameter switch rather than as part of the function signature in ambiguous case #2

Open jamesbascle opened 7 years ago

jamesbascle commented 7 years ago

Allow

.Switch(a => a++) .Match(a => a++)

instead of

.Switch((int a) => a++) .Match((int a) => a++)

in ambiguous cases.

These seem relatively rare in practice since the compiler infers the type very well based on what members are accessed inside the function.