Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter names can duplicate seq/instance names #923

Closed
Mingun opened this issue Nov 21, 2021 · 1 comment
Closed

Parameter names can duplicate seq/instance names #923

Mingun opened this issue Nov 21, 2021 · 1 comment
Milestone

Comments

@Mingun
Copy link

Mingun commented Nov 21, 2021

Right now any parameter of a type are transformed to a field in the generated type like a regular seq/instance attribute in all targets and, consequently, shares the same namespace. However, the compiler doesn't check that parameter names are not the same as seq/instance attributes:

meta:
  id: parameters_bug
params:
  - id: param
    type: bool
seq:
  - id: param
    size: 1
# instances:
#   param:
#     value: param

Because there is no dedicated syntax in the expression language to distinguish between parameter names and other attributes, it seems that such ability most likely a bug not a feature, and should be prohibited.

@GreyCat
Copy link
Member

GreyCat commented Nov 21, 2021

We have seq_parse_inst_id_clash.ksy and seq_value_inst_id_clash.ksy:

seq_parse_inst_id_clash.ksy: /instances/foo: error: duplicate attribute ID 'foo', previously defined at /seq/0
seq_value_inst_id_clash.ksy: /instances/bar: error: duplicate attribute ID 'bar', previously defined at /seq/1

but looks like we've missed yet another corner case. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants