Skip to content

Commit

Permalink
Generic static local functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimatay authored Jul 31, 2024
1 parent 30999bc commit 89a80b1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions StaticLocalFunctions/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ static void Main(string[] args)
Console.WriteLine(Extraction(x,y));

static int Extraction(int val1, int val2) => val1 - val2;

void GenericMessage<Value>(Value x) => Console.WriteLine($"Value from generic message: {x}");

GenericMessage<int>(12);
GenericMessage<School>(new School("SAU"));
}

int Foo()
Expand All @@ -34,8 +39,5 @@ int Foo()
}
}

class School
{
public string SchoolName { get; set; }
}
record School(string SchoolName);
}

0 comments on commit 89a80b1

Please sign in to comment.