Skip to content

Instantly share code, notes, and snippets.

@VladD2
Created November 15, 2017 02:43
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 VladD2/b0508d3178624dbc9a73853ae998f59b to your computer and use it in GitHub Desktop.
Save VladD2/b0508d3178624dbc9a73853ae998f59b to your computer and use it in GitHub Desktop.
using System.Console;
[Record] class A { public Foo : B { get; } }
[Record] class B { public Bar : int { get; } }
module Program
{
Main() : void
{
def obj1 : object = A(B(42));
match (obj1)
{
| A(Foo=B(Bar=bar)) => WriteLine($"Bar=$bar");
| _ => WriteLine("Ops!");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment