diff --git a/formats_err/enum_unknown_inst_value.ksy b/formats_err/enum_unknown_inst_value.ksy index 4e1fb1e8..cbc0a94f 100644 --- a/formats_err/enum_unknown_inst_value.ksy +++ b/formats_err/enum_unknown_inst_value.ksy @@ -1,5 +1,5 @@ # enum_unknown_inst_value.ksy: /instances/should_fail/enum: -# error: unable to find enum 'animal', searching from enum_unknown_inst_value +# error: unable to find enum 'animal', searching from 'enum_unknown_inst_value' # meta: id: enum_unknown_inst_value diff --git a/formats_err/enum_unknown_seq.ksy b/formats_err/enum_unknown_seq.ksy index e443f5b7..5e4c8675 100644 --- a/formats_err/enum_unknown_seq.ksy +++ b/formats_err/enum_unknown_seq.ksy @@ -1,5 +1,5 @@ # enum_unknown_seq.ksy: /seq/0/enum: -# error: unable to find enum 'animal', searching from enum_unknown_seq +# error: unable to find enum 'animal', searching from 'enum_unknown_seq' # meta: id: enum_unknown_seq diff --git a/formats_err/expr_cast_type_unknown.ksy b/formats_err/expr_cast_type_unknown.ksy index 9963795c..ff0afff5 100644 --- a/formats_err/expr_cast_type_unknown.ksy +++ b/formats_err/expr_cast_type_unknown.ksy @@ -1,5 +1,5 @@ # expr_cast_type_unknown.ksy: /instances/foo_bar/value: -# error: unable to find type 'bar', searching from expr_cast_type_unknown +# error: unable to find type 'bar', searching from 'expr_cast_type_unknown' # meta: id: expr_cast_type_unknown diff --git a/formats_err/expr_compare_enum2.ksy b/formats_err/expr_compare_enum2.ksy index 10f37f19..15788c7e 100644 --- a/formats_err/expr_compare_enum2.ksy +++ b/formats_err/expr_compare_enum2.ksy @@ -1,5 +1,5 @@ # expr_compare_enum2.ksy: /seq/1/if: -# error: can't compare EnumType(List(animal),Int1Type(false)) and Int1Type(true) +# error: can't compare EnumType(EnumRef(false,List(),animal),Int1Type(false)) and Int1Type(true) # meta: id: expr_compare_enum2 diff --git a/formats_err/expr_enum_unknown.ksy b/formats_err/expr_enum_unknown.ksy index db3e0204..bf57ecce 100644 --- a/formats_err/expr_enum_unknown.ksy +++ b/formats_err/expr_enum_unknown.ksy @@ -1,5 +1,5 @@ # expr_enum_unknown.ksy: /seq/1/if: -# error: unable to find enum 'unknown_enum', searching from expr_enum_unknown +# error: unable to find enum 'unknown_enum', searching from 'expr_enum_unknown' # meta: id: expr_enum_unknown diff --git a/formats_err/expr_field_unknown_endian_switch_cases.ksy b/formats_err/expr_field_unknown_endian_switch_cases.ksy index 66d80919..7d17b076 100644 --- a/formats_err/expr_field_unknown_endian_switch_cases.ksy +++ b/formats_err/expr_field_unknown_endian_switch_cases.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_endian_switch_cases.ksy: /meta/endian/cases/Name(identifier(qux)): -# error: unable to access 'qux' in expr_field_unknown_endian_switch_cases context +# error: unable to access 'qux' in 'expr_field_unknown_endian_switch_cases' context # meta: id: expr_field_unknown_endian_switch_cases diff --git a/formats_err/expr_field_unknown_endian_switch_on.ksy b/formats_err/expr_field_unknown_endian_switch_on.ksy index 555d5eb8..0455aa08 100644 --- a/formats_err/expr_field_unknown_endian_switch_on.ksy +++ b/formats_err/expr_field_unknown_endian_switch_on.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_endian_switch_on.ksy: /meta/endian/switch-on: -# error: unable to access 'qux' in expr_field_unknown_endian_switch_on context +# error: unable to access 'qux' in 'expr_field_unknown_endian_switch_on' context # meta: id: expr_field_unknown_endian_switch_on diff --git a/formats_err/expr_field_unknown_if_inst_pos.ksy b/formats_err/expr_field_unknown_if_inst_pos.ksy index 3c59851d..3dfabe33 100644 --- a/formats_err/expr_field_unknown_if_inst_pos.ksy +++ b/formats_err/expr_field_unknown_if_inst_pos.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_if_inst_pos.ksy: /instances/foo/if: -# error: unable to access 'bar' in expr_field_unknown_if_inst_pos context +# error: unable to access 'bar' in 'expr_field_unknown_if_inst_pos' context # meta: id: expr_field_unknown_if_inst_pos diff --git a/formats_err/expr_field_unknown_if_inst_value.ksy b/formats_err/expr_field_unknown_if_inst_value.ksy index 761f2f15..b8b6208a 100644 --- a/formats_err/expr_field_unknown_if_inst_value.ksy +++ b/formats_err/expr_field_unknown_if_inst_value.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_if_inst_value.ksy: /instances/foo/if: -# error: unable to access 'bar' in expr_field_unknown_if_inst_value context +# error: unable to access 'bar' in 'expr_field_unknown_if_inst_value' context # meta: id: expr_field_unknown_if_inst_value diff --git a/formats_err/expr_field_unknown_if_seq.ksy b/formats_err/expr_field_unknown_if_seq.ksy index c4b5ef03..5bd85aa6 100644 --- a/formats_err/expr_field_unknown_if_seq.ksy +++ b/formats_err/expr_field_unknown_if_seq.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_if_seq.ksy: /seq/0/if: -# error: unable to access 'bar' in expr_field_unknown_if_seq context +# error: unable to access 'bar' in 'expr_field_unknown_if_seq' context # meta: id: expr_field_unknown_if_seq diff --git a/formats_err/expr_field_unknown_inst_value_enum.ksy b/formats_err/expr_field_unknown_inst_value_enum.ksy index 6023a023..28ed69a8 100644 --- a/formats_err/expr_field_unknown_inst_value_enum.ksy +++ b/formats_err/expr_field_unknown_inst_value_enum.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_inst_value_enum.ksy: /instances/foo/value: -# error: unable to access 'bar' in expr_field_unknown_inst_value_enum context +# error: unable to access 'bar' in 'expr_field_unknown_inst_value_enum' context # meta: id: expr_field_unknown_inst_value_enum diff --git a/formats_err/expr_field_unknown_params_call.ksy b/formats_err/expr_field_unknown_params_call.ksy index 1086c4ae..18336d34 100644 --- a/formats_err/expr_field_unknown_params_call.ksy +++ b/formats_err/expr_field_unknown_params_call.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_params_call.ksy: /seq/0/type: -# error: unable to access 'bar' in expr_field_unknown_params_call context +# error: unable to access 'bar' in 'expr_field_unknown_params_call' context # meta: id: expr_field_unknown_params_call diff --git a/formats_err/expr_field_unknown_switch_cases.ksy b/formats_err/expr_field_unknown_switch_cases.ksy index b8588882..d61f5688 100644 --- a/formats_err/expr_field_unknown_switch_cases.ksy +++ b/formats_err/expr_field_unknown_switch_cases.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_switch_cases.ksy: /seq/1/type/cases/Name(identifier(ahem)): -# error: unable to access 'ahem' in expr_field_unknown_switch_cases context +# error: unable to access 'ahem' in 'expr_field_unknown_switch_cases' context # meta: id: expr_field_unknown_switch_cases diff --git a/formats_err/expr_field_unknown_switch_on.ksy b/formats_err/expr_field_unknown_switch_on.ksy index 6fd504c8..dd6d7ec2 100644 --- a/formats_err/expr_field_unknown_switch_on.ksy +++ b/formats_err/expr_field_unknown_switch_on.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_switch_on.ksy: /seq/0/type/switch-on: -# error: unable to access 'bar' in expr_field_unknown_switch_on context +# error: unable to access 'bar' in 'expr_field_unknown_switch_on' context # meta: id: expr_field_unknown_switch_on diff --git a/formats_err/expr_field_unknown_switch_params_call.ksy b/formats_err/expr_field_unknown_switch_params_call.ksy index e0b29e07..c88bec27 100644 --- a/formats_err/expr_field_unknown_switch_params_call.ksy +++ b/formats_err/expr_field_unknown_switch_params_call.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_switch_params_call.ksy: /seq/0/type/cases/Bool(true): -# error: unable to access 'bar' in expr_field_unknown_switch_params_call context +# error: unable to access 'bar' in 'expr_field_unknown_switch_params_call' context # meta: id: expr_field_unknown_switch_params_call diff --git a/formats_err/expr_field_unknown_valid_any_of.ksy b/formats_err/expr_field_unknown_valid_any_of.ksy index 846d4e03..2a77ef62 100644 --- a/formats_err/expr_field_unknown_valid_any_of.ksy +++ b/formats_err/expr_field_unknown_valid_any_of.ksy @@ -1,8 +1,8 @@ # expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/1: -# error: unable to access 'bar' in expr_field_unknown_valid_any_of context +# error: unable to access 'bar' in 'expr_field_unknown_valid_any_of' context # # expr_field_unknown_valid_any_of.ksy: /seq/0/valid/any-of/3: -# error: unable to access 'qux' in expr_field_unknown_valid_any_of context +# error: unable to access 'qux' in 'expr_field_unknown_valid_any_of' context # meta: id: expr_field_unknown_valid_any_of diff --git a/formats_err/expr_field_unknown_valid_eq_long.ksy b/formats_err/expr_field_unknown_valid_eq_long.ksy index 2a131e0e..84da5a53 100644 --- a/formats_err/expr_field_unknown_valid_eq_long.ksy +++ b/formats_err/expr_field_unknown_valid_eq_long.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_valid_eq_long.ksy: /seq/0/valid/eq: -# error: unable to access 'bar' in expr_field_unknown_valid_eq_long context +# error: unable to access 'bar' in 'expr_field_unknown_valid_eq_long' context # meta: id: expr_field_unknown_valid_eq_long diff --git a/formats_err/expr_field_unknown_valid_eq_short.ksy b/formats_err/expr_field_unknown_valid_eq_short.ksy index ae6e183e..b4394ec5 100644 --- a/formats_err/expr_field_unknown_valid_eq_short.ksy +++ b/formats_err/expr_field_unknown_valid_eq_short.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_valid_eq_short.ksy: /seq/0/valid: -# error: unable to access 'bar' in expr_field_unknown_valid_eq_short context +# error: unable to access 'bar' in 'expr_field_unknown_valid_eq_short' context # meta: id: expr_field_unknown_valid_eq_short diff --git a/formats_err/expr_field_unknown_valid_expr.ksy b/formats_err/expr_field_unknown_valid_expr.ksy index 96f0ff89..44dc54ef 100644 --- a/formats_err/expr_field_unknown_valid_expr.ksy +++ b/formats_err/expr_field_unknown_valid_expr.ksy @@ -1,5 +1,5 @@ # expr_field_unknown_valid_expr.ksy: /seq/0/valid/expr: -# error: unable to access 'bar' in expr_field_unknown_valid_expr context +# error: unable to access 'bar' in 'expr_field_unknown_valid_expr' context # meta: id: expr_field_unknown_valid_expr diff --git a/formats_err/expr_field_unknown_valid_range.ksy b/formats_err/expr_field_unknown_valid_range.ksy index 6e8a258a..cfedcc3a 100644 --- a/formats_err/expr_field_unknown_valid_range.ksy +++ b/formats_err/expr_field_unknown_valid_range.ksy @@ -1,8 +1,8 @@ # expr_field_unknown_valid_range.ksy: /seq/0/valid/min: -# error: unable to access 'bar' in expr_field_unknown_valid_range context +# error: unable to access 'bar' in 'expr_field_unknown_valid_range' context # # expr_field_unknown_valid_range.ksy: /seq/0/valid/max: -# error: unable to access 'qux' in expr_field_unknown_valid_range context +# error: unable to access 'qux' in 'expr_field_unknown_valid_range' context # meta: id: expr_field_unknown_valid_range diff --git a/formats_err/imports/enum_one.ksy b/formats_err/imports/enum_one.ksy new file mode 100644 index 00000000..0a322963 --- /dev/null +++ b/formats_err/imports/enum_one.ksy @@ -0,0 +1,10 @@ +# This is a file that is imported in imports_enum_leaking.ksy +meta: + id: enum_one +seq: + - id: something + type: u1 + enum: one +enums: + one: + 0: zero diff --git a/formats_err/imports/enum_two.ksy b/formats_err/imports/enum_two.ksy new file mode 100644 index 00000000..9fe016b8 --- /dev/null +++ b/formats_err/imports/enum_two.ksy @@ -0,0 +1,16 @@ +# This is a file that is imported in imports_enum_leaking.ksy +meta: + id: enum_two + # Note: missing import of `enum_one` +seq: + - id: one + type: u1 + enum: enum_one::one # Note: `enum_one` is not imported in this spec, so this should cause a compile error +instances: + # Enum resolution in value instances significantly different from enum resolution in other attributes + instance_one: + value: 0 + enum: enum_one::one # Note: `enum_one` is not imported in this spec, so this should cause a compile error +enums: + two: + 0: zero diff --git a/formats_err/imports/type_one.ksy b/formats_err/imports/type_one.ksy new file mode 100644 index 00000000..1247d2a5 --- /dev/null +++ b/formats_err/imports/type_one.ksy @@ -0,0 +1,6 @@ +# This is a file that is imported in imports_type_leaking.ksy +meta: + id: type_one +seq: + - id: something + size: 4 diff --git a/formats_err/imports/type_two.ksy b/formats_err/imports/type_two.ksy new file mode 100644 index 00000000..35f05ae0 --- /dev/null +++ b/formats_err/imports/type_two.ksy @@ -0,0 +1,7 @@ +# This is a file that is imported in imports_type_leaking.ksy +meta: + id: type_two + # Note: missing import of `type_one` +seq: + - id: one + type: type_one # Note: `type_one` is not imported in this spec, so this should cause a compile error diff --git a/formats_err/imports_enum_leaking.ksy b/formats_err/imports_enum_leaking.ksy new file mode 100644 index 00000000..8135894d --- /dev/null +++ b/formats_err/imports_enum_leaking.ksy @@ -0,0 +1,25 @@ +# imports/enum_two.ksy: /seq/0/enum: +# error: unable to find type 'enum_one', searching from 'enum_two' +# +# imports/enum_two.ksy: /instances/instance_one/enum: +# error: unable to find type 'enum_one', searching from 'enum_two' +# +meta: + id: imports_enum_leaking + imports: + - imports/enum_one + - imports/enum_two +seq: + - id: another_one + type: u1 + enum: enum_one::one + - id: another_two + type: u1 + enum: enum_two::two +instances: + instance_one: + value: 0 + enum: enum_one::one + instance_two: + value: 0 + enum: enum_two::two diff --git a/formats_err/imports_type_leaking.ksy b/formats_err/imports_type_leaking.ksy new file mode 100644 index 00000000..609b1331 --- /dev/null +++ b/formats_err/imports_type_leaking.ksy @@ -0,0 +1,13 @@ +# imports/type_two.ksy: /seq/0/type: +# error: unable to find type 'type_one', searching from 'type_two' +# +meta: + id: imports_type_leaking + imports: + - imports/type_one + - imports/type_two +seq: + - id: another_one + type: type_one + - id: another_two + type: type_two diff --git a/formats_err/params_def_type_unknown.ksy b/formats_err/params_def_type_unknown.ksy index 7597bd78..5f963cdf 100644 --- a/formats_err/params_def_type_unknown.ksy +++ b/formats_err/params_def_type_unknown.ksy @@ -1,5 +1,5 @@ # params_def_type_unknown.ksy: /params/0/type: -# error: unable to find type 'bar', searching from params_def_type_unknown +# error: unable to find type 'bar', searching from 'params_def_type_unknown' # meta: id: params_def_type_unknown diff --git a/formats_err/type_unknown.ksy b/formats_err/type_unknown.ksy index 6e29cbed..27748c11 100644 --- a/formats_err/type_unknown.ksy +++ b/formats_err/type_unknown.ksy @@ -1,5 +1,5 @@ # type_unknown.ksy: /seq/0/type: -# error: unable to find type 'some_unknown_name', searching from type_unknown +# error: unable to find type 'some_unknown_name', searching from 'type_unknown' # meta: id: type_unknown diff --git a/formats_err/type_unknown_many.ksy b/formats_err/type_unknown_many.ksy index 0cdce035..236b2703 100644 --- a/formats_err/type_unknown_many.ksy +++ b/formats_err/type_unknown_many.ksy @@ -1,11 +1,17 @@ # type_unknown_many.ksy: /seq/0/type: -# error: unable to find type 'some_unknown_name', searching from type_unknown_many +# error: unable to find type 'some_unknown_name', searching from 'type_unknown_many' # # type_unknown_many.ksy: /seq/1/type: -# error: unable to find type 'also_unknown_name', searching from type_unknown_many +# error: unable to find type 'also_unknown_name', searching from 'type_unknown_many' # # type_unknown_many.ksy: /seq/2/enum: -# error: unable to find enum 'unknown_enum', searching from type_unknown_many +# error: unable to find enum 'unknown_enum', searching from 'type_unknown_many' +# +# type_unknown_many.ksy: /seq/3/type: +# error: unable to find type 'unknown_type_in_array', searching from 'type_unknown_many' +# +# type_unknown_many.ksy: /seq/4/enum: +# error: unable to find enum 'unknown_enum_in_array', searching from 'type_unknown_many' # meta: id: type_unknown_many @@ -18,3 +24,10 @@ seq: - id: baz type: u1 enum: unknown_enum + - id: type_in_array + type: unknown_type_in_array + repeat: eos + - id: enum_in_array + type: u1 + enum: unknown_enum_in_array + repeat: eos diff --git a/formats_err/type_unknown_switch.ksy b/formats_err/type_unknown_switch.ksy index 879be41a..201c3fae 100644 --- a/formats_err/type_unknown_switch.ksy +++ b/formats_err/type_unknown_switch.ksy @@ -1,5 +1,5 @@ # type_unknown_switch.ksy: /seq/0/type/cases/IntNum(42): -# error: unable to find type 'some_unknown_name', searching from type_unknown_switch +# error: unable to find type 'some_unknown_name', searching from 'type_unknown_switch' # meta: id: type_unknown_switch