Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2017-07-28 12:12:47 +0300
committerMarek Safar <marek.safar@gmail.com>2017-07-28 12:14:42 +0300
commitbda280c5e854e3124692256729c3a551945c1494 (patch)
tree04ff0456d8a6c2bc024c92cc9f00ab7b1c7482ef
parent41ecc70a69dd11e304c31e9815f8fe94e661727c (diff)
[mcs] Implements cloning for yield break. Fixes #57796
-rw-r--r--mcs/errors/cs1621-2.cs21
-rw-r--r--mcs/mcs/iterators.cs1
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)