unoplatform / Uno.CodeGen

A set of source generators for equality, immutability, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't update the value of a property on Immutable object when the property has [EqualityIgnore] attribute

abrull opened this issue · comments

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

When you have an immutable type with a property that has the [EqualityIgnore] attribute and you update that property with the .WithXXX syntax then the new value is ignored. I see the issue is in the builder that when comparing the cached value with the new value, .Equals returns true so it'll return the cached value.

Expected behavior

When you update a property that has the [EqualityIgnore] attribute, that value should still be updatable

Minimal reproduction of the problem with instructions

Here's a simple repo reproducing this issue
https://github.com/abrull/TestUnoImmutables