Skip to content
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

Optional arguments regression #3384

Open
mmusu3 opened this issue Jan 30, 2025 · 0 comments
Open

Optional arguments regression #3384

mmusu3 opened this issue Jan 30, 2025 · 0 comments
Labels
Bug Decompiler The decompiler engine itself

Comments

@mmusu3
Copy link

mmusu3 commented Jan 30, 2025

Input code

class OptionalArgumentTest
{
    static void Test()
    {
        Test2();
        Test3();
        Test4();
    }

    static void Test2(int a = 0) { }
    static void Test3(int a = 0, int? b = null) { }
    static void Test4(int? b = null, int a = 0) { }
}

Erroneous output

internal class OptionalArgumentTest
{
    private static void Test()
    {
        Test2();
        Test3(0, null);
        Test4(null);
    }

    private static void Test2(int a = 0)
    {
    }

    private static void Test3(int a = 0, int? b = null)
    {
    }

    private static void Test4(int? b = null, int a = 0)
    {
    }
}

The output compiles but the nullable types do not respect the OptionalArguments decompiler setting. Other parameter types still work. This is a regression, the version I used previously was 90946ae

Details

  • Product in use: e.g. ILSpy 9.0 VS extension
@mmusu3 mmusu3 added Bug Decompiler The decompiler engine itself labels Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

1 participant