2006-10-25 Brian Crowell <brian@fluggo.com>
Fix #79703
* generic.cs (CheckConstraints): Allow generic parameters with
inheritance constraints to satisfy reference type constraints.
In tests:
2006-10-25 Brian Crowell <brian@fluggo.com>
* gtest-295.cs: New test from #79703.
svn path=/trunk/mcs/; revision=66954
+2006-10-25 Brian Crowell <brian@fluggo.com>
+
+ Fix #79703
+ * generic.cs (CheckConstraints): Allow generic parameters with
+ inheritance constraints to satisfy reference type constraints.
+
2006-10-09 Martin Baulig <martin@ximian.com>
* generic.cs
if (agc != null) {
if (agc is Constraints)
((Constraints) agc).Resolve (ec);
- is_class = agc.HasReferenceTypeConstraint;
- is_struct = agc.HasValueTypeConstraint;
+ is_class = agc.IsReferenceType;
+ is_struct = agc.IsValueType;
} else {
is_class = is_struct = false;
}
+2006-10-25 Brian Crowell <brian@fluggo.com>
+
+ * gtest-295.cs: New test from #79703.
+
2006-10-04 Martin Baulig <martin@ximian.com>
* known-issues-mcs, known-issues-gmcs: Updated the anonymous
--- /dev/null
+namespace Test {
+ class Cache<T> where T : class {
+ }
+
+ class Base {
+ }
+
+ class MyType<T> where T : Base {
+ Cache<T> _cache; // CS0452
+ }
+
+ class Foo { static void Main () { object foo = new MyType<Base> (); } }
+}