Skip to content

Pull member up didn't qualify things appropriately #39744

@jasonmalinowski

Description

@jasonmalinowski

Version Used:

Steps to Reproduce:

  1. Have an empty class derive from a base class that is also empty. Have these be in two separate files, and no using statements in either file.
  2. In the derived class, add a method like void M(CancellationToken token) { }, and invoke add using for CancellationToken.
  3. Use "pull member up" to pull this up.

Expected Behavior: the code in the base class either qualifies CancellationToken or adds a using.
Actual Behavior: nothing happens, so the resulting code doesn't even compile.

This is perhaps related to #34427 where the customer is concerned that we aren't minimally qualifying things, or #35806 which has a much longer conversation about automatically adding usings. But it seems this is even more broken: we aren't even generating valid code at all...

Metadata

Metadata

Assignees

Labels

Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringshelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions