Author: raja
Date: 2007-10-18 08:27:08 -0400 (Thu, 18 Oct 2007)
New Revision: 87747
Modified:
trunk/mcs/mcs/ChangeLog
trunk/mcs/mcs/ecore.cs
Log:
* ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
handling for generic parameters.
Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog 2007-10-18 12:01:05 UTC (rev 87746)
+++ trunk/mcs/mcs/ChangeLog 2007-10-18 12:27:08 UTC (rev 87747)
@@ -1,3 +1,8 @@
+2007-10-18 Raja R Harinath <[EMAIL PROTECTED]>
+
+ * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
+ handling for generic parameters.
+
2007-10-15 Marek Safar <[EMAIL PROTECTED]>
* class.cs (FixedField): Removed redundant volatile check.
Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs 2007-10-18 12:01:05 UTC (rev 87746)
+++ trunk/mcs/mcs/ecore.cs 2007-10-18 12:27:08 UTC (rev 87747)
@@ -339,12 +339,24 @@
if (type == TypeManager.anonymous_method_type)
return;
- if (Type.FullName == target.FullName){
+ if (TypeManager.IsGenericParameter (Type) &&
TypeManager.IsGenericParameter (target) && type.Name == target.Name) {
+#if GMCS_SOURCE
+ string sig1 = Type.DeclaringMethod == null ?
+ TypeManager.CSharpName
(Type.DeclaringType) :
+ TypeManager.CSharpSignature
(Type.DeclaringMethod);
+ string sig2 = target.DeclaringMethod == null ?
+ TypeManager.CSharpName
(target.DeclaringType) :
+ TypeManager.CSharpSignature
(target.DeclaringMethod);
Report.ExtraInformation (loc,
String.Format (
- "The type {0} has two conflicting
definitions, one comes from {1} and the other from {2}",
+ "The generic parameter `{0}' of
`{1}' cannot be converted to the generic parameter `{0}' of `{2}' (in the
previous ",
+ Type.Name, sig1, sig2));
+#endif
+ } else if (Type.FullName == target.FullName){
+ Report.ExtraInformation (loc,
+ String.Format (
+ "The type `{0}' has two conflicting
definitions, one comes from `{1}' and the other from `{2}' (in the previous ",
Type.FullName, Type.Assembly.FullName,
target.Assembly.FullName));
-
}
if (expl) {
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches