linux-packaging-mono/mcs/ilasm/tests/generics-variance.il
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

43 lines
890 B
Plaintext

//
// Test a generic type type param field
//
.assembly extern mscorlib { }
.namespace Mono.ILASM.Tests {
.class public Covariant<+T> extends [mscorlib]System.Object {
.field public !0 val
.method public instance void .ctor () {
ret
}
}
.class public Contravariant<-T> extends [mscorlib]System.Object {
.field public !0 val
.method public instance void .ctor () {
ret
}
}
.class public Driver extends [mscorlib]System.Object {
.method public static void Main () {
.entrypoint
newobj instance void class Mono.ILASM.Tests.Covariant<string>::.ctor ()
castclass class Mono.ILASM.Tests.Covariant<object>
call void [mscorlib]System.Console::WriteLine (object)
newobj instance void class Mono.ILASM.Tests.Covariant<object>::.ctor ()
castclass class Mono.ILASM.Tests.Covariant<string>
call void [mscorlib]System.Console::WriteLine (object)
ret
}
}
}