I came across an issue on the Exquisite Corpse project in C#

This is my code
Program.cs(143,6): error CS8370: Feature ‘static local functions’ is not available in C# 7.3. Please use language version 8.0 or greater. [/home/ccuser/workspace/csharp-exquisite-corpse/workspace.csproj]
this is what I counter when I debug the code

Hey, I had this problem too for a really long time and it was driving my bonkers.

I would try getting rid of the “public” key word and then double check to see whether or not your method is accidentally nested inside another method; that’s what my problem was, I couldn’t figure it out till I realized that I had forgotten to get out of the “SwitchCase()” in order to write the “TranslateToNumber();”

the static local functions refers to the functions being nested, theres more information here : https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/static-local-functions#:~:text=A%20static%20local%20function%20definition,the%20enclosing%20static%20local%20function.
hopefully it helps :slight_smile:

the error looked like this

static int function(){
blah blah code…;

static int function2(){
blah blah code;
}
}

and it’s supposed to be like

static int code{
blah blah blah;
}
static int code1{
blah blah blah;
}

Thanks a lot!
You were right! my switch statement was nested in one another.
Thanks a lot for the help