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>2012-09-06 23:06:15 +0400
committerMarek Safar <marek.safar@gmail.com>2012-09-06 23:08:17 +0400
commit417ec7840f3f9195b03115f0c8c25aaa646a5b04 (patch)
tree7ad848ef8137d783c9bb5b6c7924ceaf63e7b3d3
parent551ca8475459f3e66e1351a83681368d9291d72b (diff)
Fix base type definition in repl. Fixes #5913.mono-2.11.4
-rw-r--r--mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs10
-rw-r--r--mcs/mcs/eval.cs6
-rw-r--r--mcs/mcs/module.cs5
-rw-r--r--mcs/mcs/namespace.cs3
4 files changed, 21 insertions, 3 deletions
diff --git a/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs b/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
index 998e629a912..bd0167efbf0 100644
--- a/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
+++ b/mcs/class/Mono.CSharp/Test/Evaluator/TypesTest.cs
@@ -85,10 +85,18 @@ namespace MonoTests.EvaluatorTest
}
[Test]
- public void GG ()
+ public void MoreThanOneType ()
{
Evaluator.Run ("public class D { int x; public int X { get { return x; } set { x = value;} } };");
Evaluator.Run ("public class C { public int Speed{get;set;}};");
}
+
+ [Test]
+ public void StructType ()
+ {
+ Evaluator.Run ("class C { }");
+ Evaluator.Run ("struct B { public string foo; public int bar; }");
+ Evaluator.Run ("B aStruct = new B { foo = \"foo\", bar = 1 };");
+ }
}
} \ No newline at end of file
diff --git a/mcs/mcs/eval.cs b/mcs/mcs/eval.cs
index c448d2b0d37..6810507d063 100644
--- a/mcs/mcs/eval.cs
+++ b/mcs/mcs/eval.cs
@@ -656,7 +656,11 @@ namespace Mono.CSharp
}
module.CreateContainer ();
- source_file.EnableUsingClausesRedefinition ();
+
+ // Disable module and source file re-definition checks
+ module.EnableRedefinition ();
+ source_file.EnableRedefinition ();
+
module.Define ();
if (Report.Errors != 0){
diff --git a/mcs/mcs/module.cs b/mcs/mcs/module.cs
index bf36e8f20e4..6fabc733356 100644
--- a/mcs/mcs/module.cs
+++ b/mcs/mcs/module.cs
@@ -412,6 +412,11 @@ namespace Mono.CSharp
return base.DefineContainer ();
}
+ public void EnableRedefinition ()
+ {
+ is_defined = false;
+ }
+
public override void EmitContainer ()
{
if (OptAttributes != null)
diff --git a/mcs/mcs/namespace.cs b/mcs/mcs/namespace.cs
index 7908f218c7d..e87d59521c4 100644
--- a/mcs/mcs/namespace.cs
+++ b/mcs/mcs/namespace.cs
@@ -1287,8 +1287,9 @@ namespace Mono.CSharp {
}
}
- public void EnableUsingClausesRedefinition ()
+ public void EnableRedefinition ()
{
+ is_defined = false;
namespace_using_table = null;
}