-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Open
Labels
Description
If a templated function has a parameter is declared with in
, and it is called with this
as a parameter, ILSpy will erroneously apply in
to it.
This only seems to happen on templated functions; if the function being called is a non-template, ILSpy will create a temporary variable set to this
and use that as a parameter.
Input
public class TestClass
{
public void DoThing<T>(in T x)
{
Console.WriteLine(x.ToString());
}
public void DoThingToSelf()
{
DoThing(this);
}
}
Erroneous output
using System;
public class TestClass
{
public void DoThing<T>(in T x)
{
Console.WriteLine(x.ToString());
}
public void DoThingToSelf()
{
DoThing(in this);
}
}
Details
- Product in use: IlSpyCmd
- Version in use: current master