SharpLab icon indicating copy to clipboard operation
SharpLab copied to clipboard

Partial method 'RegexExtensions.IsABC()' must have an implementation part because it has accessibility modifiers.

Open KyleMit opened this issue 2 years ago • 3 comments

I'm trying to see the generated code using the new GeneratedRegex in .NET 7

using System.Text.RegularExpressions;

public static partial class RegexExtensions {
    [GeneratedRegex($@"[abc]")]
    public static partial Regex IsABC();
}

But I get the following error:

error CS8795: Partial method 'RegexExtensions.IsABC()' must have an implementation part because it has accessibility modifiers.

Demo URL

Is there anything funky needed to support generators like this?

KyleMit avatar Mar 03 '23 21:03 KyleMit

Interesting, thanks for reporting! I would guess generators do need some extra setup that SharpLab does not have yet. I'll take a look when I have a moment.

ashmind avatar Mar 11 '23 21:03 ashmind

+1. Not sure if this is relevant to the service itself, or for the dotnet.

Rasmus715 avatar Jul 21 '23 13:07 Rasmus715

after a year, is there any thing new on this ?

John0King avatar Jul 26 '24 04:07 John0King