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

Bug in generic interfaces with default implementations #34323

Closed
wimvangool opened this issue Mar 31, 2020 · 4 comments
Closed

Bug in generic interfaces with default implementations #34323

wimvangool opened this issue Mar 31, 2020 · 4 comments
Labels
area-TypeSystem-coreclr untriaged New issue has not been triaged by the area owner

Comments

@wimvangool
Copy link

I've bumped into a strange issue that when I..

  • Implement a generic interface with at least one generic type parameter, and...
  • Add two generic overloads to that interface, where the type parameter constraint on the method's generic type parameter references the parent interface's generic type parameter, and...
  • One of the overloads provides a default implementation...

...then when I try to call the interface's overload that provides the default implementation with a type parameter that satisfies all constraint, the compiler thinks it's fine, but the run-time throws a System.Security.VerificationException at the point of invoking the interface method.

For more explanation and a way to reproduce this error, see my question on StackOverflow.

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this issue. Please help me learn by adding exactly one area label.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Mar 31, 2020
@jkotas jkotas changed the title Bug in C# 8.0 compiler or .NET Core 3 run-time Bug in generic interfaces with default implementations Mar 31, 2020
@jkotas
Copy link
Member

jkotas commented Mar 31, 2020

cc @MichalStrehovsky

@vcsjones
Copy link
Member

vcsjones commented Apr 1, 2020

According to the linked Stack Overflow post, this is a dupe of #13588.

@mangod9
Copy link
Member

mangod9 commented Apr 15, 2020

This is a dupe of #1674, which has been recently fixed.

@mangod9 mangod9 closed this as completed Apr 15, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-TypeSystem-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

5 participants