Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Created February 20, 2024 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonpryor/7f6db19d56d073ce6ee0994133bc85ac to your computer and use it in GitHub Desktop.
Save jonpryor/7f6db19d56d073ce6ee0994133bc85ac to your computer and use it in GitHub Desktop.
using System.Collections.Generic;
interface IFruit {
string Name {get;}
}
class Banana : IFruit {
public string Name => "Banana";
}
class Test {
public static void Main ()
{
var bananas = new Banana[]{
new Banana(),
new Banana(),
};
IList<Banana> b = bananas;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment