Project
ReSharper
Priority
Major
Type
Bug
Fix versions
2.5.1
State
Fixed
Assignee
Olga Lobacheva
Subsystem
No subsystem
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Olga Lobacheva
    5 years ago (14 Dec 2006 20:48)
  • Updated by   Olga Lobacheva
    5 years ago (14 Dec 2006 23:47)
  • Jira: RSRP-33456
    (history, comments)
 
RSRP-33456 TypeParameter have to take into account its base types
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
It's fine compiled code.

namespace Bug
{

public class BaseP
{
public static implicit operator int(BaseP p) { return 0; }
public static int operator +(BaseP p, BaseP p1) { return 0; }
public void F(){}
}

public class BaseP1: BaseP
{
public static implicit operator bool(BaseP1 p) { return true; }
public static bool operator +(BaseP1 p, string p1) { return true; }
}

public class Test<T, U> where T : BaseP, U
where U: BaseP1
{
public void G(BaseP t) { }
public void G1(int t) { }

public void F()
{
T t = default(T);
t.F();
int x = t;
bool y = t;
int result = t + t;
bool result1 = t + "";
}
}
}

Issue was closed
Comments (2)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Olga Lobacheva
  Olga Lobacheva
14 Dec 2006 20:57
5 years ago
May be it's time to refactor ResolveUtil.AddDeclarationsForProperDeclaredType method? Implement it not using MiscUtil.GetAllSuperSmth but in handy recursive way? Or it's not good for some reason?
Olga Lobacheva
  Olga Lobacheva
14 Dec 2006 21:35
5 years ago
Hm, it seems that correct way is to put not only non static members to the table but all and then filter (situation about interface member via class with static members).
Or may be to put only static 'special' members (it is a little bit hack i think).

Anyway I think it's time to refactor AddDeclarations method.