Last active
June 4, 2017 00:52
-
-
Save masaeedu/46f7b4f6175734059ddcec20b53602e2 to your computer and use it in GitHub Desktop.
"var" for props/fields
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
| static class X | |
| { | |
| public static X<T> Create<T>(T t) { return new X<T>(t); } | |
| } | |
| class X<T> | |
| { | |
| T MyT { get; } | |
| public X(T t) | |
| { | |
| MyT = t; | |
| } | |
| } | |
| class Program | |
| { | |
| static void Main() | |
| { | |
| var x = X.Create(10); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment