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

VS's Go To Definition disassembler handles static interface methods incorrectly #60567

Closed
vitek-karas opened this issue Apr 4, 2022 · 0 comments · Fixed by #60618
Closed
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug
Milestone

Comments

@vitek-karas
Copy link
Member

Version Used: Version 17.3.0 Preview 1.0 [32401.348.main]

Steps to Reproduce:

Create a new .NET 6 console app.

Program.cs:

using System.Runtime.Versioning;

[assembly: RequiresPreviewFeatures]

namespace SITest
{
    public class Program
    {
        public static void Main()
        {
        }

        public static T GetOne<T>() where T : INumber<T>
        {
            return T.One;
        }

        public static T GetMyOne<T>() where T : IMyNumber<T>
        {
            return T.One;
        }
    }

    public interface IMyNumber<TSelf>
    {
        static abstract TSelf One { get; }
    }
}

Add a package reference:

<PackageReference Include="System.Runtime.Experimental" Version="6.0.0" />

Open in VS and navigate to the T.One inside the GetMyOne method. Then "Go to definition" on the One identifier. This goes to the:

        static abstract TSelf One { get; }

Now do the same for the One in GetOne method. This shows line (generated from metadata):

        TSelf One { get; }

Expected Behavior:
The static interface methods must be static abstract, so the source generated from metadata should include that.

Actual Behavior:
The source generated from metadata treats these as normal interface methods (non-static).

/cc @agocke

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 4, 2022
@jinujoseph jinujoseph added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 6, 2022
@jinujoseph jinujoseph modified the milestones: 17.2, 17.3 Apr 6, 2022
@jinujoseph jinujoseph added the 4 - In Review A fix for the issue is submitted for review. label Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants