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

Fix ArgumentException caused by Enum constraint on method out parameter #658

Merged
merged 4 commits into from
Aug 28, 2023

Commits on Aug 28, 2023

  1. Add failing test for generic by-ref parameter constrained to Enum

    This triggers a `ArgumentException`: "Cannot create an instance of
    `TEnum` because `Type.ContainsGenericParameters` is true."
    stakx committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    d7f5b69 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    18b514c View commit details
    Browse the repository at this point in the history
  3. Reorder checks so the 1st looks less special-casey

     * As the previous commit showed, the `IsGenericParameter` check must
       have priority... probably not just over enums, but over any other
       value types, too.
    
     * The `IsEnum` check can be put behind `IsValueType` so it does not run
       for non-value types.
    stakx committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    e9c957c View commit details
    Browse the repository at this point in the history
  4. Update changelog

    stakx committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    1bc7f18 View commit details
    Browse the repository at this point in the history