Model Creation/Instantiation Allows Duplicate names (except for properties) #2208
Labels
enhancement
Possible enhancement
hacktoberfest
help/PR welcome
Help/Pull request from contributors to fix the issue is welcome
level: easy
Bug report
Sandbox link or minimal reproduction code
https://codesandbox.io/p/sandbox/duplicate-views-no-error-92z9c7
Describe the expected behavior
In this code:
Notice that we encounter no runtime errors on the duplicate names. In some cases, like the duplicate view names, some editors may report a redline about the duplicate. But that does not seem to happen across
actions
andviews
method calls.We noticed this in #2207 (review), because we were moving some of the
properties
duplicate checks into theviews
andactions
methods, and I was expecting to see other duplicate checks, but none exist.What should happen?
If a user defines a model with duplicate keys, instead of overwriting the prior keys, we should throw a helpful error that says something like "[keyname] exists already in [views | actions | volatile]", much like we do when users duplicate a property on the model itself.
What happens instead?
No runtime errors, and the most recently defined property overwrites the least recently defined properties.
The text was updated successfully, but these errors were encountered: