Skip to content

Instantly share code, notes, and snippets.

View En3Tho's full-sized avatar

Igor Bagdamyan En3Tho

  • 11:58 (UTC +03:00)
View GitHub Profile
@En3Tho
En3Tho / Co_ntra_varianceCheatSheet.cs
Created February 12, 2025 11:19
Co(ntra)variance cheatsheet
interface ICovariant<out T>;
interface IContravariant<in T>;
interface IConcrete<T>;
class Foo1;
class Foo2 : Foo1, ICovariant<Foo2>, IContravariant<Foo2>, IConcrete<Foo2>;
class Foo3 : Foo2;
static void Test()
{