linux-packaging-mono/mcs/tests/gtest-variance-3.cs

20 lines
293 B
C#
Raw Normal View History

delegate T Foo<out T> ();
public class Test
{
public static int Main ()
{
string message = "Hello World!";
Foo<string> foo = () => message;
if (Bar (foo) != message.GetHashCode ())
return 1;
return 0;
}
static int Bar (Foo<object> foo)
{
return foo().GetHashCode ();
}
}