Skip to content

Further investigate regression in primary constructor decompilation #3611

@siegfriedpammer

Description

@siegfriedpammer

After the recent fixes the issue with PCFieldInitTest becomes the same as the C3 test in #3452. The primary constructor parameter wrongly gets referenced outside of field initialization and generates an extra backing field when recompiled. For PCFieldInitTest it now looks like this:

internal abstract class PCFieldInitTest(StringComparison value)
{
	private StringComparison _value = value;

	public bool Func()
	{
		// Should be `_value` not `value`
		return value == StringComparison.Ordinal;
	}
}

Sorry if the naming difference was too subtle, I could have made it clearer.

Originally posted by @mmusu3 in #3610

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDecompilerThe decompiler engine itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions