Skip to content

Instantly share code, notes, and snippets.

@WiredUK
Created October 17, 2017 11:56
Show Gist options
  • Save WiredUK/21d1a61c01580a2fe7b055ec83b46889 to your computer and use it in GitHub Desktop.
Save WiredUK/21d1a61c01580a2fe7b055ec83b46889 to your computer and use it in GitHub Desktop.
public void Method1((string, string) parameter)
{
switch (parameter)
{
case var tObj when tObj.Item1 == "x":
break;
}
}
//Fails with:
//CS1061 'object' does not contain a definition for 'Item1' and no extension method 'Item1' accepting a first argument of type 'object' could be found
public void Method2(object parameter)
{
switch (parameter)
{
case var tObj when tObj.Item1 == "x":
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment