A bytekód is statikusan típusos, legalábbis C# alatt biztosan.
Vegyünk egy ilyen kódot:
int i = 0;
while(i<10)
i++;
Ebből ez az IL kód lesz:
IL_0000: ldc.i4.0 // Push 0 of type int32 onto the stack as int32.
IL_0001: stloc.0 // Pop a value from stack into local variable 0
IL_0002: br.s IL_0008 // Brach to target
IL_0004: ldloc.0 // Load local variable 0 onto stack.
IL_0005: ldc.i4.1 // Push 1 onto the stack as int32.
IL_0006: add // Add two values, returning a new value
IL_0007: stloc.0 // Pop a value from stack into local variable 0
IL_0008: ldloc.0 // Load local variable 0 onto stack.
IL_0009: ldc.i4.s 10 // Push 10 onto the stack as int32, short form.
IL_000b: blt.s IL_0004 // Branch to target if less than, short form.
IL_000d: ret // Return from method, possibly with a value.
Na, ez így nem túl szép, viszont elég típusos.
Viszot a belőle fordított assembly:
xor eax,eax
loop0: inc eax
cmp eax,0Ah
jl loop0
ret
Más kérdés hogy a C#-ban lehet olyasmit csinálni ami nem ilyen szép, de bizony a dolog elég statikusan típusos.