Skip to content
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

1.0.6 BC break? #41

Closed
mcrio opened this issue Jan 26, 2019 · 5 comments
Closed

1.0.6 BC break? #41

mcrio opened this issue Jan 26, 2019 · 5 comments

Comments

@mcrio
Copy link

mcrio commented Jan 26, 2019

Hi, seems 1.0.6 NuGet version introduced an additional constraint on TValue to be of struct type, but I can't really find when and where this happened here in the repo. Also can't really find the previous versions tags. Am I missing something? :)

@ardalis
Copy link
Owner

ardalis commented Jan 27, 2019

I wasn't applying tags until this version, sorry. Do you have an example of a non-struct TValue you could share?

@mcrio
Copy link
Author

mcrio commented Jan 27, 2019

Hi Ardalis, 1.0.5 doesn't have the struct constraint on TValue.
Seems it was introduced here: 1c9bf3e#diff-b71ca71881242d3857a980ff13d4309dR34

@ardalis
Copy link
Owner

ardalis commented Jan 27, 2019

Right, that was a major PR introduced by @aalmada which had a big positive perf impact. What negative impact are you seeing from the constraint? What scenario is it limiting?

Remember SmartEnum's primary goal is replacing the standard enum type and making it better by having each option be a class rather than a primitive. A standard enum can only be a very short list of types:

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/enum

The approved types for an enum are byte, sbyte, short, ushort, int, uint, long, or ulong.

@mcrio
Copy link
Author

mcrio commented Jan 27, 2019

Thanks. I was using it with string values.
I don't have a large codebase depending on SmartEnum and string as a value so I can get away with refactoring the code.

@ardalis
Copy link
Owner

ardalis commented Jan 27, 2019

Ok, thanks. Of course if you stick with 1.0.5 you should be fine, too. Unless I hear that this is breaking a lot of other people, though, I think I'm fine to have SmartEnum expect a struct Value going forward.

@ardalis ardalis closed this as completed Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants