Skip to content

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

Merged
metoule merged 3 commits intodynamicexpresso:masterfrom
metoule:fix_270
Feb 14, 2023
Merged

No longer crash when trying to match a generic method that'll violate the generic constraints#274
metoule merged 3 commits intodynamicexpresso:masterfrom
metoule:fix_270

Conversation

@metoule
Copy link
Copy Markdown
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
Copy Markdown
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