Skip to content

Error Prone: bounds and element_bounds #347

@RLi43

Description

@RLi43

If we define something like

param:
  type: double_array
  description: "This param is supposed to be an array."
  default_value: [0.0, 0.0, 0.0]
  validation:
    fixed_size<>: [3]
    bounds<>: [0.0, 1000.0] # It should be element_bounds

If we provide

param: [0.0, 0.0, 0.0]

it will say "parameter 'param' has a invalid type: expected [double] got [double_array]".

If we provide

param: 0.0

it will say "parameter 'param' has a invalid type: expected [double_array] got [double]"

The root cause is that in the parameter definition, validation section, it should use element_bounds instead of bounds. It would be nice if we can check the parameter type and validation method are compatible during compilation. Otherwise the error message is confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions