Skip to content

The this keyword causes errors in the "Move Method" refactoring. #4299

@assdfsdafasfa

Description

@assdfsdafasfa

Select the "methodToBeMoved" method, and perform "move" refactoring
Before refactoring

class SourceClass {
     TargetClass t;
     void methodToBeMoved(SourceClass this) {}
}
class TargetClass{}

After refactoring

 class SourceClass {
     TargetClass t;
}
class TargetClass{
    void methodToBeMoved(SourceClass this) {}
}

Error message: The declared type of the explicit 'this' parameter is expected to be TargetClass

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions