Skip to content

Instantly share code, notes, and snippets.

@daneb
Last active June 21, 2019 12:25
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 daneb/e0ed55842fdaa89527ace839d2abfe34 to your computer and use it in GitHub Desktop.
Save daneb/e0ed55842fdaa89527ace839d2abfe34 to your computer and use it in GitHub Desktop.
Statically Typed C#
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