We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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:
T.One
GetMyOne
One
static abstract TSelf One { get; }
Now do the same for the One in GetOne method. This shows line (generated from metadata):
GetOne
TSelf One { get; }
Expected Behavior: The static interface methods must be static abstract, so the source generated from metadata should include that.
static abstract
Actual Behavior: The source generated from metadata treats these as normal interface methods (non-static).
/cc @agocke
The text was updated successfully, but these errors were encountered:
davidwengier
Successfully merging a pull request may close this issue.
Version Used: Version 17.3.0 Preview 1.0 [32401.348.main]
Steps to Reproduce:
Create a new .NET 6 console app.
Program.cs:
Add a package reference:
Open in VS and navigate to the
T.One
inside theGetMyOne
method. Then "Go to definition" on theOne
identifier. This goes to the:Now do the same for the
One
inGetOne
method. This shows line (generated from metadata):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
The text was updated successfully, but these errors were encountered: