Last active
June 21, 2019 12:25
-
-
Save daneb/e0ed55842fdaa89527ace839d2abfe34 to your computer and use it in GitHub Desktop.
Statically Typed C#
This file contains 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
public class StaticallyTypedCSharp | |
{ | |
[Fact] | |
public void StaticTypeWontCompile() | |
{ | |
Object o = "Hello"; | |
Assert.True(o.Length == 5); | |
} | |
[Fact] | |
public void StaticTypeCompileEnforced() | |
{ | |
Object o = "Hello"; | |
Assert.True(((string)o).Length == 5); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment