Description
Currently if the parameters of a PROTO instance are not stored in the correct order (for example in a world or parent PROTO file), it is possible that at the load the USE nodes refer to the wrong DEF node because:
- Webots DEF dictionary is based on the PROTO definition fields order (the same that is also displayed in the scene tree)
- WbNodeReader DEF dictionary is based on the reading order
Errors do not only occur if some default PROTO parameter values are used, but also in case of custom parameters.
But the main problem is that no warning is printed in the console and the user might not notice the issue.
Adding some additional computations (like looping through the parameter subnodes) it is possible to detect if the currently unordered field contains DEF nodes. If we add additional steps it should also be possible to detect if the current parameter is really shadowing previous parameter DEF nodes.
Or we could simply print a warning for each unordered list of PROTO parameters.
So the main question is which level of precision (and code complexity) we would like to have for the warning.
Note that if we print a warning for each unordered list of PROTO parameters, many user's simulations might print this new warning.