Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Apr 27, 2012 8:16:13 AM |
Updated | Apr 27, 2012 8:16:13 AM |
Priority | Normal |
Type | Bug |
Fix versions | No Fix versions |
State | Submitted |
Assignee | Unassigned |
Subsystem | No subsystem |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
using System; sealed class C<T> : IComparable<T> { static void Main() { var c = new C<int>(); var x = c.CompareTo(1); // Apply QF } int IComparable<T>.CompareTo(T other) { return 0; } }
Actual:
using System; sealed class C<T> : IComparable<T> { static void Main() { var c = new C<int>(); var x = ((IComparable<T>)c).CompareTo(1); // error CS0030: Cannot convert type 'C<int>' to 'System.IComparable<T>' } int IComparable<T>.CompareTo(T other) { return 0; } }
Expected:
using System; sealed class C<T> : IComparable<T> { static void Main() { var c = new C<int>(); var x = ((IComparable<int>)c).CompareTo(1); // OK } int IComparable<T>.CompareTo(T other) { return 0; } }