You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the Bug
At the moment, Node fields in PROTOs are required to list every type which they can accept (if they are type restricted). However, this us true even if all of the necessary types share a common base type which would be sufficient. This leads to verbose type restrictions where only a single actual type is required, and is unintuitive given the inheritance-style structure of nodes.
Steps to Reproduce
Attempt to load the PROTOs:
# Base.proto
#VRML_SIM R2023b utf8
PROTO Base [] { Pose {} }
# ExtendsBase.proto
#VRML_SIM R2023b utf8
EXTERNPROTO "../protos/Base.proto"
PROTO ExtendsBase [] { Base {} }
# Example.proto
#VRML_SIM R2023b utf8
EXTERNPROTO "../protos/Base.proto"
EXTERNPROTO "../protos/ExtendsBase.proto"
PROTO Example [
unconnectedField MFNode{Base{},Solid{}} f [ExtendsBase{},LightSensor{}]
]
{ Pose {} }
When trying to load Example.proto, Webots will state that the default values of f are not permitted even though ExtendsBaseis an instance of Base, and LightSensoris an instance of Solid.
Expected behavior
The entire ancestry of nodes should be considered when determining if they satisfy a node restriction. This would make the above code valid.
System
Operating System: Windows 10
Graphics Card: NVIDIA GeForce 1050 Ti
The text was updated successfully, but these errors were encountered:
That sounds like a good idea. Please go ahead with the implementation and open a new PR to propose your contribution. We will review it and likely accept it.
Describe the Bug
At the moment, Node fields in PROTOs are required to list every type which they can accept (if they are type restricted). However, this us true even if all of the necessary types share a common base type which would be sufficient. This leads to verbose type restrictions where only a single actual type is required, and is unintuitive given the inheritance-style structure of nodes.
Steps to Reproduce
Attempt to load the PROTOs:
When trying to load
Example.proto
, Webots will state that the default values off
are not permitted even thoughExtendsBase
is an instance ofBase
, andLightSensor
is an instance ofSolid
.Expected behavior
The entire ancestry of nodes should be considered when determining if they satisfy a node restriction. This would make the above code valid.
System
The text was updated successfully, but these errors were encountered: