✓
Passing Passing: the compiler rejects this program as expected.
Code
// PINS: two field names that differ only in `-` vs `_` collide in the
// emitted struct — kebab mangles to snake at identifier formation on every
// target, so `a-b` and `a_b` write one member downstream and the field
// list must refuse the pair at declaration.
const std = @import("std");
~tor scan {}
| found { a-b: i32, a_b: i64 }
| miss
~scan => miss
~scan()
| found f |> _
| miss |> _
Actual compiler output
error[PARSE010]: fields 'a-b' and 'a_b' in branch 'found' write the same member — '-' and '_' are one identifier in the emitted struct; rename one
--> tests/regression/200_COMPILER_FEATURES/210_PARSER/210_333_field_kebab_snake_collide_refused/input.kz:6:1
|
6 | ~tor scan {}
| ^
hint: kebab '-' mangles to '_' at identifier formation — two spellings, one struct member downstreamFrontend must reject with:
CONTAINS error[PARSE010]
CONTAINS write the same member
ERROR_AT 6
NOT_CONTAINS output_emitted.zigFlows
flow ~scan click a branch to expand · @labels scroll to their anchor
scan
Test Configuration
MUST_ERROR