over_react icon indicating copy to clipboard operation
over_react copied to clipboard

UIP-3014 Warn when key uses default toString impl

Open greglittlefield-wf opened this issue 8 years ago • 1 comments

With key being dynamic and toString-ing values, it's easy to pass in any object.

It's also easy to pass in objects with non-unique toString implementations, such as the default Object.toString, and not notice that the value won't help when keying.

class Foo {
  final bar;
  Foo(this.bar);
}
..key = new Foo(1) // Uses "Instance of 'Foo'" as key
..key = new Foo(2) // Uses "Instance of 'Foo'" as key

We should check whether values like this are specified (perhaps via a regex, like ^Instance of '[_\$a-zA-Z0-9]+'$) and warn in the console.

greglittlefield-wf avatar Feb 06 '18 22:02 greglittlefield-wf

It looks like you have not included any tickets in the title of this issue. Please create a ticket for this issue, or click a type to create one automatically: Task, Bug, Improvement

rmconsole2-wf avatar Feb 06 '18 22:02 rmconsole2-wf