2007-06-06 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Wed, 6 Jun 2007 14:04:22 +0000 (14:04 -0000)
committerMarek Safar <marek.safar@gmail.com>
Wed, 6 Jun 2007 14:04:22 +0000 (14:04 -0000)
* ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
internal
error not an user error.

* expression.cs (IsApplicable): Refactored to make debugging
easier.

* support.cs: More tricks for non-mono runtimes.

* typemanager.cs (CoreLookupType): Made public.
(InitSystemCore): All linq specific stuff moved to linq.cs

svn path=/trunk/mcs/; revision=78738

mcs/mcs/ChangeLog
mcs/mcs/ecore.cs
mcs/mcs/expression.cs
mcs/mcs/support.cs
mcs/mcs/typemanager.cs

index d8989572c583e094d6d659b5dfef3d60007fd05f..c120850dabd73ab964e06bc33b49dd0c9801ca0a 100644 (file)
@@ -1,3 +1,15 @@
+2007-06-06  Marek Safar  <marek.safar@gmail.com>
+
+       * ecore.cs (SimpleName.Emit): Emit unresolved simple name is internal
+       error not an user error.
+        
+       * expression.cs (IsApplicable): Refactored to make debugging easier.
+
+       * support.cs: More tricks for non-mono runtimes.
+       
+       * typemanager.cs (CoreLookupType): Made public.
+       (InitSystemCore): All linq specific stuff moved to linq.cs
+
 2007-06-05  Marek Safar  <marek.safar@gmail.com>
 
        * typemanager.cs (CSharpSignature): One more missing build-in types
index c57756f31d60736d3f5711925ed8e18d839d0fd3..861d10c0c8114f9a79013bd38434456d7678d0a2 100644 (file)
@@ -2372,14 +2372,7 @@ namespace Mono.CSharp {
                
                public override void Emit (EmitContext ec)
                {
-                       //
-                       // If this is ever reached, then we failed to
-                       // find the name as a namespace
-                       //
-
-                       Error (103, "The name `" + Name +
-                              "' does not exist in the class `" +
-                              ec.DeclContainer.Name + "'");
+                       throw new InternalErrorException ("The resolve phase was not executed");
                }
 
                public override string ToString ()
index d25fddb40abcf9cc6aba683ae4d47d02e6145cd7..85b79e376300f3f7796f6ebd1713bb011d3d9fc7 100644 (file)
@@ -4261,32 +4261,35 @@ namespace Mono.CSharp {
                                i--;
 
                                Argument a = (Argument) arguments [i];
-
+                               
                                Parameter.Modifier a_mod = a.Modifier &
                                        ~(Parameter.Modifier.OUTMASK | Parameter.Modifier.REFMASK);
 
                                Parameter.Modifier p_mod = pd.ParameterModifier (i) &
                                        ~(Parameter.Modifier.OUTMASK | Parameter.Modifier.REFMASK | Parameter.Modifier.PARAMS);
 
-                               if (a_mod == p_mod) {
-                                       Type pt = pd.ParameterType (i);
-                                       EmitContext prevec = EmitContext.TempEc;
-                                       EmitContext.TempEc = ec;
-
-                                       try {
-                                               if (a_mod == Parameter.Modifier.NONE) {
-                                                       if (!TypeManager.IsEqual (a.Type, pt) &&
-                                                           !Convert.ImplicitConversionExists (ec, a.Expr, pt))
-                                                               return false;
-                                                       continue;
-                                               }
-                                       } finally {
-                                               EmitContext.TempEc = prevec;
+                               if (a_mod != p_mod)
+                                       return false;
+
+                               Type pt = pd.ParameterType (i);
+                               EmitContext prevec = EmitContext.TempEc;
+                               EmitContext.TempEc = ec;
+
+                               try {
+                                       if (a_mod == Parameter.Modifier.NONE) {
+                                               // It is already done in ImplicitConversion need to measure the performance, it causes problem in MWF
+                                               if (TypeManager.IsEqual (a.Type, pt))
+                                                 continue;
+
+                                               if (!Convert.ImplicitConversionExists (ec, a.Expr, pt))
+                                                       return false;
+                                               continue;
                                        }
+                               } finally {
+                                       EmitContext.TempEc = prevec;
+                               }
                                        
-                                       if (pt != a.Type)
-                                               return false;
-                               } else
+                               if (pt != a.Type)
                                        return false;
                        }
 
index 3fdd91b530648165dfee3a3ec98fd91098c693d3..3f072b6c53e8e4f653320c3a96293f9c89fcf9a5 100644 (file)
@@ -151,14 +151,18 @@ namespace Mono.CSharp {
                                        }
                                        continue;
                                }
-
+                               
                                if (types[i].IsGenericType) {
-                                       Type[] gen_arguments = types[i].GetGenericTypeDefinition ().GetGenericArguments ();
-                                       for (int ii = 0; ii < gen_arguments.Length; ++ii) {
-                                               gen_arguments[ii] = argTypes[gen_arguments[ii].GenericParameterPosition];
+                                       Type[] gen_arguments_open = types[i].GetGenericTypeDefinition ().GetGenericArguments ();
+                                       Type[] gen_arguments = types[i].GetGenericArguments ();
+                                       for (int ii = 0; ii < gen_arguments_open.Length; ++ii) {
+                                               if (gen_arguments[ii].IsGenericParameter)
+                                                       gen_arguments_open[ii] = argTypes[gen_arguments_open[ii].GenericParameterPosition];
+                                               else
+                                                       gen_arguments_open[ii] = gen_arguments[ii];
                                        }
 
-                                       types[i] = types[i].GetGenericTypeDefinition ().MakeGenericType (gen_arguments);
+                                       types[i] = types[i].GetGenericTypeDefinition ().MakeGenericType (gen_arguments_open);
                                }
                        }
                }
index 6987168eca679f1052155e4933bc4bf921e9558f..854fe831600014001e151671e28ebf78d1124395 100644 (file)
@@ -864,7 +864,7 @@ namespace Mono.CSharp {
        ///   Looks up a type, and aborts if it is not found.  This is used
        ///   by types required by the compiler
        /// </summary>
-       static Type CoreLookupType (string namespaceName, string name)
+       public static Type CoreLookupType (string namespaceName, string name)
        {
                return CoreLookupType (namespaceName, name, false);
        }
@@ -1356,8 +1356,6 @@ namespace Mono.CSharp {
        }
 
 #if GMCS_SOURCE
-       public static MethodInfo enumerable_select;
-
        static void InitSystemCore ()
        {
                if (RootContext.Version != LanguageVersion.LINQ)
@@ -1366,13 +1364,6 @@ namespace Mono.CSharp {
                if (extension_attribute_type != null)
                        extension_attribute_attr = new CustomAttributeBuilder (
                                GetConstructor (extension_attribute_type, Type.EmptyTypes), new object[0]);
-
-               Type t = CoreLookupType ("System.Linq", "Enumerable");
-               MemberList select = TypeManager.FindMembers (t, MemberTypes.Method, BindingFlags.Static | BindingFlags.Public,
-                       Type.FilterName, "Select");
-
-               // TODO: implement correct selection
-               enumerable_select = ((MethodInfo)select[0]);
        }
 #endif