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

Unexpected error "feature 'ref struct interfaces' is not available" #76401

Open
jjonescz opened this issue Dec 12, 2024 · 0 comments
Open

Unexpected error "feature 'ref struct interfaces' is not available" #76401

jjonescz opened this issue Dec 12, 2024 · 0 comments
Assignees
Labels
Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. Feature - RefStructInterfaces
Milestone

Comments

@jjonescz
Copy link
Member

Version Used: 4.13.0-3.24612.1 (c30de30)

Steps to Reproduce:

Compile with LangVersion=12:

using System.Diagnostics.CodeAnalysis;
interface I
{
    void M();
}
struct S : I
{
    [UnscopedRef] void I.M() { } // errors here
}

Expected Behavior: Only error CS9102: UnscopedRefAttribute cannot be applied to an interface implementation because implemented member 'I.M()' doesn't have this attribute.

Actual Behavior: Additional error CS9202: Feature 'ref struct interfaces' is not available in C# 12.0. Please use language version 13.0 or greater.

But there is no ref struct implementing an interface.

@jjonescz jjonescz added Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. Feature - RefStructInterfaces labels Dec 12, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 12, 2024
@jaredpar jaredpar removed the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 16, 2024
@jaredpar jaredpar added this to the 17.14 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Concept-Diagnostic Clarity The issues deals with the ease of understanding of errors and warnings. Feature - RefStructInterfaces
Projects
None yet
Development

No branches or pull requests

3 participants