dotnet/roslyn
Bug in Move Type to Namespace refactoring - usings not added for namespaces in same file
Aberta
#50.672 aberto em 21 de jan. de 2021
Area-IDEBughelp wanted
Métricas do repositório
- Stars
- (20.414 estrelas)
- Métricas de merge de PR
- (Métricas PR pendentes)
Description
Version Used: Visual Studio 16.9.0 Preview 3.0
Sample Code:
using System;
namespace Tests
{
internal class Foo
{
public static int Do(Inner.Data d) => 42;
}
}
namespace Tests {
namespace Inner
{
public class App
{
static void Main()
{
Console.WriteLine(Foo.Do(new Data()));
}
}
public class Data { }
}
}
Steps to Reproduce:
- Move type
Footo NamespaceSomething.Else
Expected Behavior: Working Code
Actual Behavior: Compile Error
Code after refatoring:
using Something.Else;
using System;
namespace Something.Else
{
internal class Foo
{
public static int Do(Inner.Data d) => 42;
}
}
namespace Tests
{
namespace Inner
{
public class App
{
static void Main()
{
Console.WriteLine(Foo.Do(new Data()));
}
}
public class Data { }
}
}
Expected Code:
using Something.Else;
using System;
using Tests.Inner;
namespace Something.Else
{
internal class Foo
{
public static int Do(Data d) => 42;
}
}
namespace Tests
{
namespace Inner
{
public class App
{
static void Main()
{
Console.WriteLine(Foo.Do(new Data()));
}
}
public class Data { }
}
}