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
using System; | |
public class InferenceTest { | |
static void Main() { | |
var superAction = new Action<ISuper>(SuperAction); | |
var superDummyFunc = new Func<ISuper, object>(SuperDummyFunc); | |
var subFunc = new Func<ISub>(SubFunc); | |
var subDummyFunc = new Func<object, ISub>(SubDummyFunc); | |
var covariantObj = (ICovariant<ISub>)null; | |
var contravariantObj = (IContravariant<ISuper>)null; | |
var invariantCovariantObj = (IInvariant<ICovariant<ISub>>)null; |
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
using System; | |
static class M { | |
static void Main() | |
{ | |
B b = new B(); | |
// Outside the scope of the B members, the A members are used | |
var x = b.Property; | |
b.Method(); | |
b.Field = true; |