-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edit and Continue for members of generic types #11036
Comments
Related Visual Studio feedback issue: https://developercommunity.visualstudio.com/t/Blazor-Hot-Reload-is-not-working-compon/10247440 |
@jnm2 Is the following transform representative of your desired scenario? We're trying to understand the cost/scope of possible improvements and we want to make sure we understand the specific ask here. // Before
class Foo<T>
{
public Foo(T a)
{
Console.WriteLine("Unknown");
}
}
public class Program
{
public static void Main()
{
var s = new Foo<string>("1");
var i = new Foo<int>(2);
Console.WriteLine(3);
}
} // After
class Foo<T>
{
public Foo(T a)
{
if (typeof(T) == typeof(int))
{
Console.WriteLine(a);
}
else if (typeof(T) == typeof(string))
{
Console.WriteLine(a);
}
else
{
Console.WriteLine("Unknown");
}
}
}
public class Program
{
public static void Main()
{
var s = new Foo<string>("1");
var i = new Foo<int>(2);
Console.WriteLine(3);
}
} |
@AaronRobinsonMSFT Yes, that could be representative. In the cases I remember, I didn't reference |
Completed with #85269 |
Modifying or adding a method in a generic type is not currently supported: https://github.com/dotnet/roslyn/blob/main/docs/wiki/EnC-Supported-Edits.md#not-supported-edits This seems like a big-ticket item, but please consider implementing it.
It comes up a lot for me. Right now, for example, I'm debugging an application and want to try eight permutations in a generic class's constructor. Building and setting up the scenario eight times is not as fun as EnC would be.
(Opened from dotnet/roslyn#29667 to track runtime work per @tmat's request.)
The text was updated successfully, but these errors were encountered: