mcintyre321 / OneOf

Easy to use F#-like ~discriminated~ unions for C# with exhaustive compile time matching
MIT License
3.53k stars 165 forks source link

Add exception messages #31

Closed ndrwrbgs closed 3 years ago

ndrwrbgs commented 6 years ago
mcintyre321 commented 6 years ago

How are you getting all these index out of bounds errors? From default(OneOf<...>)?

ndrwrbgs commented 6 years ago

For the first one, that would be from the other PR and should probably be handled there.

For the second, it was mostly an improvement suggestion.

The third and fourth were just from reading through the code and noticing the ambiguity if the input function was null.

mcintyre321 commented 6 years ago

Switch/Match, it looks like they should probably throw ArgumentExceptions if you don't provide funcs (rather than InvalidOperationExceptions, which is what happens now), is that what you are referring to?

mcintyre321 commented 3 years ago

CLosing due to lack of activity, PRs welcome