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

const value of decimal will not be removed from static ctor #2547

Closed
yyjdelete opened this issue Nov 11, 2021 · 0 comments
Closed

const value of decimal will not be removed from static ctor #2547

yyjdelete opened this issue Nov 11, 2021 · 0 comments
Labels
Bug Decompiler The decompiler engine itself

Comments

@yyjdelete
Copy link
Contributor

Input code

public class Class1
{
    const decimal a = 1.0m;

    static Class1()
    {
        //Do something
    }
}

Erroneous output

public class Class1
{
	private const decimal a = 1.0m;

	static Class1()
	{
		a = 1.0m;
	}
}

If the output fails to re-compile, provide the compiler error message.

CS0131: The left-hand side of an assignment must be a variable, property or indexer

Details

  • Product in use: ILSpy
  • Version in use: 7.2.0.6702-preview2
@yyjdelete yyjdelete added Bug Decompiler The decompiler engine itself labels Nov 11, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

1 participant