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-10-10 12:26:11 +0300
committerMarek Safar <marek.safar@gmail.com>2017-10-10 18:08:38 +0300
commit4718035ee67d90b3f965f8537e79e125d96a4ce5 (patch)
tree7c8f557c12de5c228d7e7ddf1fba67e4ff3fa69f /mcs/class/Mono.CSharp
parent1c9cf1f1c00c21ad6777ff00bcd650bab36b0234 (diff)
[mcs] Adds workaround for compiled enum types used as fields of other types. Fixes #59080
Diffstat (limited to 'mcs/class/Mono.CSharp')
-rw-r--r--mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
index 97f9e047e6d..f8bf63455de 100644
--- a/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
+++ b/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
@@ -131,5 +131,17 @@ namespace MonoTests.EvaluatorTest
{
Evaluator.Run ("public class TestClass { private TestEnum _te; public string Get() { return _te.ToString(); } } public enum TestEnum { First, Second }");
}
+
+ [Test]
+ public void EnumTypeWithOrderDependency ()
+ {
+ Evaluator.Run ("public class TestClass { public enum TestEnum { Val1, Val2, Val3 } public TestEnum test; public TestClass() { test = TestEnum.Val3; } }");
+ object res = Evaluator.Evaluate ("new TestClass()");
+
+ var fields = res.GetType ().GetFields ();
+ foreach (var field in fields) {
+ Console.WriteLine ($"{field.Name} = {field.MemberType}");
+ }
+ }
}
} \ No newline at end of file