Project
ReSharper
Priority
Normal
Type
Bug
Fix versions
Mirabile Futurum
State
Open
Assignee
Alexander Shvedov
Subsystem
Generate
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Yuri Astrakhan
    4 years ago (09 Mar 2008 00:47)
  • Updated by   Kirill Falk
    5 months ago (26 Dec 2011 14:43)
  • Jira: RSRP-60812
    (history, comments)
 
RSRP-60812 Add parameter incorrectly propagates types
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
void Foo<TFoo>(System.Func<TFoo, bool> param1, System.Func<TFoo, TFoo, bool> param2)
{
    Bar(param1, param2);
}

void Bar<TBar>(System.Func<TBar, bool> param)
{ }


R# correctly offers to add param2 to the function Bar, but when it does, it keeps the original generic type names instead of adjusting them:

void Foo<TFoo>(System.Func<TFoo, bool> param1, System.Func<TFoo, TFoo, bool> param2)
{
    Bar(param1, param2);
}

void Bar<TBar>(System.Func<TBar, bool> param, System.Func<TFoo, TFoo, bool> param2)
{ }


The typed parameter param2 in method Bar() should be TBar, not TFoo.
Comments (2)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Andrey Simanovsky
  Andrey Simanovsky
13 Mar 2008 15:46
4 years ago
ReSharper may add a TFoo to type parameters list of Bar as well.
Yuri Astrakhan
  Yuri Astrakhan
13 Mar 2008 17:34
4 years ago
It could, but is it possible for R# to trace that if the existing parameter param1 is using a known type TFoo which is mapped to TBar in the called method, and since the new parameter also uses that same type, R# would do remapping automatically?