Created
January 29, 2014 02:02
-
-
Save VladimirReshetnikov/8680476 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; | |
| using System.Collections.Generic; | |
| struct S | |
| { | |
| ValueType x; | |
| static void Main() | |
| { | |
| var s = new S(); | |
| ValueType v = s; | |
| dynamic d = v; | |
| d.x = v; | |
| s = (S) v; | |
| var set = new HashSet<S> { s }; | |
| Console.WriteLine(set.Contains(s)); // Can you tell the result? | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment