by bmicraft · 1w ago · 0 comments
I've found this is usually because they don't have the other part they're duplicating fully in context. Telling it to read a couple relevant files fully helps - that often makes it come up with more elegant solutions too.
this.FooA = new Foo();
this.FooB = new Foo();
this.Foos = [this.FooA, this.FooB];
this.Foo = this.Foos;
These were entirely new objects with no existing instances of this pattern in this codebase. There were no references at all to the duplicate properties.