Created
November 15, 2017 02:43
-
-
Save VladD2/b0508d3178624dbc9a73853ae998f59b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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