-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Incorrect decompilation of base constructor calls (named arguments) #950
Comments
This is still happening in some cases. Still only with VS 2013. Source: class BaseClass
{
protected BaseClass(int? arg1 = null,
int? arg2 = null,
string arg3 = null,
bool arg4 = false,
bool arg5 = false,
bool arg6 = false)
{ }
}
class DerivedClass : BaseClass
{
public DerivedClass()
: base(arg3: "", arg5: true, arg4: true, arg6: true) { }
} Output: internal class BaseClass
{
protected BaseClass(int? arg1 = default(int?), int? arg2 = default(int?), string arg3 = null, bool arg4 = false, bool arg5 = false, bool arg6 = false)
{
}
}
internal class DerivedClass : BaseClass
{
public DerivedClass()
{
bool arg = true;
base..ctor(null, null, "", arg4: true, arg, arg6: true);
}
} |
Please do not revive closed issues. You can open a new issue for each problem you discover. Thank you! |
Sorry! I figured since it seemed to be the same issue that it would fit here. I will open new issues in future. Also thank you for fixing my other recent issues so quickly! |
This appears to be fixed now. Tested at commit f6aae1f. |
Thanks for validating. Closing the issue (if the problem reappears, please open a new issue as point out by Siegi) |
Only an issue with pre-Roslyn compiler, tested with VS2013. Using named arguments out original order causes local variables to be used before base constructor is called.
Test case:
Output:
The text was updated successfully, but these errors were encountered: