Project
ReSharper
Priority
Normal
Type
Bug
Fix versions
No Fix versions
State
Open
Assignee
Sergey Shkredov
Subsystem
Refactorings
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Igor A
    3 years ago (21 May 2009 14:01)
  • Updated by   Jura Gorohovsky
    10 months ago (08 Jul 2011 16:46)
  • Jira: RSRP-108632
    (history, comments)
 
RSRP-108632 'Extract superclass' refactoring: do correct result for generic classes in special case
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
Steps to reproduce:
1. Choose 'Extract superclass' refactoring to SomeClass from following code:
public class SomeClass<T>
{
    private const float someConst = 0.5f;
    public float MyAAA()
    {
        return someConst;
    }
    public SomeClass(T items)
    {
    }
}

Corresponding dialog appears.
2. Select someConst in this dialog and press Next button.
Wrong result: there is error in code:
public class SomeClassBase<T>
{
    protected const float someConst = 0.5f;
}

public class SomeClass<T> : SomeClassBase<T>
{
    public float MyAAA()
    {
        return SomeClassBase.someConst;
    }
    public SomeClass(T items)
    {
    }
}

It should be:
...
public class SomeClass<T> : SomeClassBase<T>
{
    public float MyAAA()
    {
        return SomeClassBase<T>.someConst;
    }
    public SomeClass(T items)
    {
    }
}

or
...
public class SomeClass<T> : SomeClassBase<T>
{
    public float MyAAA()
    {
        return someConst;
    }
    public SomeClass(T items)
    {
    }
}
Comments (0)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Issue has no comments