ashmind / SharpLab

.NET language playground
https://sharplab.io
BSD 2-Clause "Simplified" License
2.68k stars 196 forks source link

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

Open KyleMit opened 1 year ago

KyleMit commented 1 year ago

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?

ashmind commented 1 year ago

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.

Rasmus715 commented 1 year ago

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

John0King commented 1 month ago

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