2010-04-29 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / eval.cs
index 66fc039a53ee0ff2a5d76777cc3b8b8dabe2ec06..2c2f297266e895895e75f0b79ee8c3f56d4744c5 100644 (file)
@@ -132,6 +132,8 @@ namespace Mono.CSharp {
 
                                Import.Initialize ();
                                driver.LoadReferences ();
+                               TypeManager.InitOptionalCoreTypes (ctx);
+
                                RootContext.EvalMode = true;
                                inited = true;
 
@@ -166,7 +168,7 @@ namespace Mono.CSharp {
                        //
 //                     if (!TypeManager.InitCoreTypes (ctx, null))
 //                             throw new Exception ("Failed to InitCoreTypes");
-                       TypeManager.InitOptionalCoreTypes (ctx);
+//                     TypeManager.InitOptionalCoreTypes (ctx);
                        
                        Location.AddFile (null, "{interactive}");
                        Location.Initialize ();
@@ -197,16 +199,17 @@ namespace Mono.CSharp {
                                if (interactive_base_class != null)
                                        return interactive_base_class;
 
-                               return interactive_base_class = Import.ImportType (typeof (InteractiveBase));
+                               return Import.ImportType (typeof (InteractiveBase));
                        }
+               }
 
-                       set {
-                               if (value == null)
-                                       throw new ArgumentNullException ();
+               public static void SetInteractiveBaseClass (Type type)
+               {
+                       if (type == null)
+                               throw new ArgumentNullException ();
 
-                               lock (evaluator_lock)
-                                       interactive_base_class = value;
-                       }
+                       lock (evaluator_lock)
+                               interactive_base_class = Import.ImportType (type);
                }
 
                /// <summary>