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

[Default Interfaces] Support constrained interface calls on value types #9490

Closed
MichalStrehovsky opened this issue Jan 2, 2018 · 4 comments

Comments

@MichalStrehovsky
Copy link
Member

Pull request dotnet/coreclr#21978 made us throw in this situation, but the correct behavior would be to make a thunk that will box the this, and dispatch to the target default interface method.

@gafter
Copy link
Member

gafter commented Oct 25, 2019

The following code compiles and runs without throwing. Not sure what scenario is not handled properly.

using System;

class Program
{
    static void Main(string[] args)
    {
        S1 s = new S1();
        M(s);
    }

    static void M<T>(T t) where T : I1
    {
        t.M();
    }
}

interface I1
{
    void M() { Console.WriteLine("I1.M"); }
}

struct S1 : I1
{
}

@MichalStrehovsky
Copy link
Member Author

It's specifically for the corner case mentioned in the pull request (there is an il test too).

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 31, 2020
@msftgits msftgits added this to the Future milestone Jan 31, 2020
Copy link
Contributor

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Apr 26, 2024
Copy link
Contributor

This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.

@dotnet-policy-service dotnet-policy-service bot removed this from the Future milestone May 10, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2024
@dotnet-policy-service dotnet-policy-service bot removed no-recent-activity backlog-cleanup-candidate An inactive issue that has been marked for automated closure. labels Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants