Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Jan 10, 2012 10:43:11 PM |
Updated | Jan 10, 2012 11:06:52 PM |
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; using System.Collections.Generic; class B<S> { public virtual void Foo<T>(Dictionary<T, S> x) { } } class C : B<string> { public override void Foo<T>(Dictionary<T, string> x) { Bar(x); // Create Bar from usage } }
Actual:
using System; using System.Collections.Generic; class B<S> { public virtual void Foo<T>(Dictionary<T, S> x) { } } class C : B<string> { public override void Foo<T>(Dictionary<T, string> x) { Bar(x); // error CS1503: Argument 1: cannot convert from 'System.Collections.Generic.Dictionary<T,string>' to 'System.Collections.Generic.Dictionary<object,string>' } private void Bar(Dictionary<object, string> dictionary) { throw new NotImplementedException(); } }
Expected:
using System; using System.Collections.Generic; class B<S> { public virtual void Foo<T>(Dictionary<T, S> x) { } } class C : B<string> { public override void Foo<T>(Dictionary<T, string> x) { Bar(x); // OK } private void Bar<T>(Dictionary<T, string> dictionary) { throw new NotImplementedException(); } }