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

Fixes xunit/xunit#2798: xUnit2007 code fix leads to CS8920 compiler error #167

Merged
merged 5 commits into from
Nov 18, 2023

Conversation

etherfield
Copy link
Contributor

Resolves #2798

@boerdereinar
Copy link

boerdereinar commented Nov 10, 2023

Does not work when adding extra abstraction layer:

public interface IInterface1 {
    public abstract void Method();
}

public interface IInterface2 : IInterface1 {
}

Also this is supported in .NET 7, but not as a preview in .NET 6.
Edit: Removed irrelevant info.

@bradwilson
Copy link
Member

bradwilson commented Nov 11, 2023

Thanks!

I assume the language preview features used here are all coming in C# 12? If so, then I'll just wait until C# 12 is released to add this. Should only be a few weeks days...

@bradwilson
Copy link
Member

It appears this feature is not in C# 12, as it's still open: dotnet/csharplang#4436

@boerdereinar
Copy link

@bradwilson
Copy link
Member

If you attempt to use it, you get told you must "enable preview features" which require attribute decoration of any affected type (or the assembly as a whole):

image

@bradwilson
Copy link
Member

Note that this is with .NET SDK 8 and C# 12.

@bradwilson
Copy link
Member

Maybe it's runtime-dependent?

@boerdereinar
Copy link

The target framework in that screenshot is .NET 6. You set it to at least .NET 7 in order for it to work.

@bradwilson bradwilson changed the title 2798 compiler error Fixes xunit/xunit#2798: xUnit2007 code fix leads to CS8920 compiler error Nov 18, 2023
@bradwilson bradwilson merged commit 0c15399 into xunit:main Nov 18, 2023
4 checks passed
@bradwilson
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants