Skip to content

Instantly share code, notes, and snippets.

@james-world
Created July 10, 2020 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save james-world/85ed6a9d437d0ec7fb65f831439cffd1 to your computer and use it in GitHub Desktop.
Save james-world/85ed6a9d437d0ec7fb65f831439cffd1 to your computer and use it in GitHub Desktop.
Dangers of stand alone discards
void Main()
{
Test1(5);
Test2(5);
}
void Test1(int _)
{
_ = 2 + 2;
Console.WriteLine(_);
}
void Test2(int x)
{
_ = 2 + 2;
Console.WriteLine(x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment