linux-packaging-mono/mcs/tests/test-anon-109.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

39 lines
615 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
public delegate void Foo ();
public class Test
{
public static implicit operator Foo (Test test)
{
return delegate { Console.WriteLine ("Hello World!"); };
}
public static IEnumerable<Test> operator + (Test test, Test foo)
{
yield return test;
yield return foo;
}
public IEnumerable<int> Foo {
get {
yield return 3;
}
set {
Console.WriteLine ("Foo!");
}
}
public static void Main ()
{
Test test = new Test ();
Foo foo = test;
foo ();
foreach (Test t in test + test)
Console.WriteLine (t);
}
}