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

No longer crash when trying to match a generic method that'll violate the generic constraints #274

Merged
merged 3 commits into from
Feb 14, 2023

Conversation

metoule
Copy link
Contributor

@metoule metoule commented Feb 11, 2023

Let's say you have a generic method with a generic constraint:

public T GenericMethodWithConstraint<T>(T input) where T : class
{
  return input;
}

It's invalid to call this method with an int, because it violates the generic constraints.
This PR catches any generic constraint violation, to avoid crashing.

Fixes #270

…rameters that violate the generic constraints
Copy link
Member

@davideicardi davideicardi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

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

Successfully merging this pull request may close these issues.

Add support of .net 7.0
2 participants