Giter Site home page Giter Site logo

1.0.6 BC break? about smartenum HOT 5 CLOSED

ardalis avatar ardalis commented on May 13, 2024
1.0.6 BC break?

from smartenum.

Comments (5)

ardalis avatar ardalis commented on May 13, 2024

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

from smartenum.

mcrio avatar mcrio commented on May 13, 2024

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

from smartenum.

ardalis avatar ardalis commented on May 13, 2024

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.

from smartenum.

mcrio avatar mcrio commented on May 13, 2024

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.

from smartenum.

ardalis avatar ardalis commented on May 13, 2024

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.

from smartenum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.