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

Something change with decimal types? #255

Closed
DevAlphaFox opened this issue Mar 18, 2024 · 2 comments
Closed

Something change with decimal types? #255

DevAlphaFox opened this issue Mar 18, 2024 · 2 comments

Comments

@DevAlphaFox
Copy link

This worked fine in v1.10, but v1.20.2 throws the following error: "CS0664: Literal of type double cannot be implicitly converted to type 'decimal'; use an 'M' suffix to create a literal of this type." It works if I remove the default parameter value or change myValue to a double.

[MemoryPackable]
public partial record TestClass {

	public decimal MyValue { get; set; }

	public TestClass(decimal myValue = 0.00m) {
		MyValue = myValue;
	}

}
@DevAlphaFox
Copy link
Author

Just to clarify, the error occurs during the build. v1.20.3 is also affected.

MemoryPack (v1 20 3) - Build Error

@hadashiA
Copy link
Contributor

Hello. Thanks for the report. And sorry. I had put a bug in #242.
We have just released the fixed version. I hope you will check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants