Created
March 24, 2012 01:41
-
-
Save mletterle/2177221 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
.assembly Test { } | |
.class public TestClass | |
extends [mscorlib]System.Object | |
{ | |
.method specialname static public void Main() cil managed | |
{ | |
.entrypoint | |
newobj instance void AnotherClass2::.ctor() | |
dup | |
callvirt instance void AnotherClass::Method(class AnotherClass) | |
ret | |
} | |
} | |
.class public AnotherClass | |
extends [mscorlib]System.Object | |
{ | |
.method specialname rtspecialname public instance void .ctor() cil managed | |
{ | |
ldarg.0 | |
call instance void [mscorlib]System.Object::.ctor() | |
ret | |
} | |
.method public void Method(class AnotherClass a) cil managed | |
{ | |
ldarg.1 | |
call instance string AnotherClass::Something() | |
call void [mscorlib]System.Console::WriteLine(string) | |
ret | |
} | |
.method public instance string Something() cil managed | |
{ | |
ldstr "AnotherClass" | |
ret | |
} | |
} | |
.class public AnotherClass2 | |
extends [mscorlib]System.Object | |
{ | |
.method specialname rtspecialname public instance void .ctor() cil managed | |
{ | |
ldarg.0 | |
call instance void [mscorlib]System.Object::.ctor() | |
ret | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, in most languages most of the type checking usually occurs in previous steps of compilation before generating the IL code, so for efficiency reasons of compilation, it's not redone. .NET would be the same.