Author: martin
Date: 2006-03-06 20:00:28 -0500 (Mon, 06 Mar 2006)
New Revision: 57640
Added:
branches/mono-1-1-13/mcs/tests/gtest-249.cs
branches/mono-1-1-13/mcs/tests/gtest-250.cs
Modified:
branches/mono-1-1-13/mcs/gmcs/ChangeLog
branches/mono-1-1-13/mcs/gmcs/expression.cs
branches/mono-1-1-13/mcs/gmcs/generic.cs
branches/mono-1-1-13/mcs/gmcs/typemanager.cs
Log:
**** Merged r57608 from MCS ****
Modified: branches/mono-1-1-13/mcs/gmcs/ChangeLog
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/ChangeLog 2006-03-07 00:39:56 UTC (rev
57639)
+++ branches/mono-1-1-13/mcs/gmcs/ChangeLog 2006-03-07 01:00:28 UTC (rev
57640)
@@ -1,3 +1,15 @@
+2006-03-06 Martin Baulig <[EMAIL PROTECTED]>
+
+ * generic.cs
+ (TypeManager.InferType): Fix gtest-250.cs.
+
+ * typemanager.cs
+ (TypeManager.IsSubclassOf): Also check the base class.
+
+ * expression.cs
+ (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
+ fixes gtest-249.cs.
+
2006-02-16 Martin Baulig <[EMAIL PROTECTED]>
* generic.cs
Modified: branches/mono-1-1-13/mcs/gmcs/expression.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/expression.cs 2006-03-07 00:39:56 UTC (rev
57639)
+++ branches/mono-1-1-13/mcs/gmcs/expression.cs 2006-03-07 01:00:28 UTC (rev
57640)
@@ -4701,7 +4701,7 @@
static internal bool IsAncestralType (Type first_type, Type
second_type)
{
return first_type != second_type &&
- (second_type.IsSubclassOf (first_type) ||
+ (TypeManager.IsSubclassOf (second_type,
first_type) ||
TypeManager.ImplementsInterface (second_type,
first_type));
}
Modified: branches/mono-1-1-13/mcs/gmcs/generic.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/generic.cs 2006-03-07 00:39:56 UTC (rev
57639)
+++ branches/mono-1-1-13/mcs/gmcs/generic.cs 2006-03-07 01:00:28 UTC (rev
57640)
@@ -2340,7 +2340,13 @@
static bool InferType (Type pt, Type at, Type[] infered)
{
- if (pt.IsGenericParameter && (pt.DeclaringMethod !=
null)) {
+ if (pt == at)
+ return true;
+
+ if (pt.IsGenericParameter) {
+ if (pt.DeclaringMethod == null)
+ return false;
+
int pos = pt.GenericParameterPosition;
if (infered [pos] == null) {
Modified: branches/mono-1-1-13/mcs/gmcs/typemanager.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/typemanager.cs 2006-03-07 00:39:56 UTC
(rev 57639)
+++ branches/mono-1-1-13/mcs/gmcs/typemanager.cs 2006-03-07 01:00:28 UTC
(rev 57640)
@@ -1590,6 +1590,9 @@
return tparam.IsSubclassOf (base_type);
}
+ if (type.IsSubclassOf (base_type))
+ return true;
+
do {
if (IsEqual (type, base_type))
return true;
Copied: branches/mono-1-1-13/mcs/tests/gtest-249.cs (from rev 57608,
trunk/mcs/tests/gtest-249.cs)
Copied: branches/mono-1-1-13/mcs/tests/gtest-250.cs (from rev 57608,
trunk/mcs/tests/gtest-250.cs)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches