diff options
-rw-r--r-- | mcs/errors/cs1621-2.cs | 21 | ||||
-rw-r--r-- | mcs/mcs/iterators.cs | 1 |
2 files changed, 21 insertions, 1 deletions
diff --git a/mcs/errors/cs1621-2.cs b/mcs/errors/cs1621-2.cs new file mode 100644 index 00000000000..fca7c673b3c --- /dev/null +++ b/mcs/errors/cs1621-2.cs @@ -0,0 +1,21 @@ +// CS1621: The yield statement cannot be used inside anonymous method blocks +// Line: 12 + +using System; +using System.Collections; + +public class Test +{ + public IEnumerator Foo () + { + Call (() => { + yield break; + }); + + yield break; + } + + void Call (Action a) + { + } +}
\ No newline at end of file diff --git a/mcs/mcs/iterators.cs b/mcs/mcs/iterators.cs index 3afe93ce5ff..c0ccf129e74 100644 --- a/mcs/mcs/iterators.cs +++ b/mcs/mcs/iterators.cs @@ -161,7 +161,6 @@ namespace Mono.CSharp protected override void CloneTo (CloneContext clonectx, Statement target) { - throw new NotSupportedException (); } protected override bool DoResolve (BlockContext bc) |