Author: marek
Date: 2007-06-06 10:04:22 -0400 (Wed, 06 Jun 2007)
New Revision: 78738
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/ecore.cs
trunk/mcs/mcs/expression.cs
trunk/mcs/mcs/support.cs
trunk/mcs/mcs/typemanager.cs
Log:
2007-06-06 Marek Safar <[EMAIL PROTECTED]>
* 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
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2007-06-06 13:44:54 UTC (rev 78737)
+++ trunk/mcs/mcs/ChangeLog 2007-06-06 14:04:22 UTC (rev 78738)
@@ -1,3 +1,15 @@
+2007-06-06 Marek Safar <[EMAIL PROTECTED]>
+
+ * 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 <[EMAIL PROTECTED]>
* typemanager.cs (CSharpSignature): One more missing build-in types
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2007-06-06 13:44:54 UTC (rev 78737)
+++ trunk/mcs/mcs/ecore.cs 2007-06-06 14:04:22 UTC (rev 78738)
@@ -2372,14 +2372,7 @@
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 ()
Modified: trunk/mcs/mcs/expression.cs
===================================================================
--- trunk/mcs/mcs/expression.cs 2007-06-06 13:44:54 UTC (rev 78737)
+++ trunk/mcs/mcs/expression.cs 2007-06-06 14:04:22 UTC (rev 78738)
@@ -4261,32 +4261,35 @@
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;
+ if (a_mod != p_mod)
+ return false;
- 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;
+ 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;
}
Modified: trunk/mcs/mcs/support.cs
===================================================================
--- trunk/mcs/mcs/support.cs 2007-06-06 13:44:54 UTC (rev 78737)
+++ trunk/mcs/mcs/support.cs 2007-06-06 14:04:22 UTC (rev 78738)
@@ -151,14 +151,18 @@
}
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);
}
}
}
Modified: trunk/mcs/mcs/typemanager.cs
===================================================================
--- trunk/mcs/mcs/typemanager.cs 2007-06-06 13:44:54 UTC (rev 78737)
+++ trunk/mcs/mcs/typemanager.cs 2007-06-06 14:04:22 UTC (rev 78738)
@@ -864,7 +864,7 @@
/// 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 @@
}
#if GMCS_SOURCE
- public static MethodInfo enumerable_select;
-
static void InitSystemCore ()
{
if (RootContext.Version != LanguageVersion.LINQ)
@@ -1366,13 +1364,6 @@
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
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches