// Reserved-name MEMBER positions are EXEMPT from the reserved-type-name rule: // a bare reserved spelling (`s2`, `u8`, `s1`, …) is legal as a struct FIELD // name, a union TAG name, and a protocol METHOD-SIGNATURE name. These are // unambiguous — the name sits in a member slot and is reached via `obj.name` // (or dispatched by string), so it is never type-classified and never // mislowers. The backtick form is optional there and resolves to the same // member. Backtick access (`obj.`s2`) and bare access (`obj.s2`) both work. // // The exemption stops at member SIGNATURES: an `impl` method DEFINITION is a // real function, so its name is a declaration site (like a free function) and a // reserved spelling still needs the backtick (`` `s2 :: (self) ``) — bare would // be type-classified and mislower (the issue-0076 protection). A bare reserved // VALUE binding / declaration name still errors (see examples/1119, 1141, 1142). // Regression (issue 0089 — attempt-7: pins the Agra-ruled member-name exemption). #import "modules/std.sx"; // Struct fields spelled with reserved type names — bare is legal. Holder :: struct { s2: s64; u8: s64; } // Union tags spelled with reserved type names — bare is legal. Tag :: union { s1: s32; u16: f64; } // Protocol method SIGNATURE spelled with a reserved type name — bare is legal. Speaker :: protocol { s2 :: () -> s64; } Dog :: struct { n: s64; } impl Speaker for Dog { `s2 :: (self: *Dog) -> s64 { self.n } // impl DEFINITION → backtick required } main :: () -> s32 { h := Holder.{ s2 = 10, u8 = 20 }; print("fields bare = {} {}\n", h.s2, h.u8); // bare member access print("fields tick = {} {}\n", h.`s2, h.`u8); // backtick member access h.s2 = 11; h.`u8 = 21; // backtick write print("fields set = {} {}\n", h.s2, h.u8); t : Tag = ---; t.s1 = 5; print("union = {} {}\n", t.s1, t.`s1); // bare + backtick — same tag items : List(Speaker) = .{}; items.append(Dog.{ n = 7 }); print("dispatch = {}\n", items.items[0].s2()); // bare reserved-name method call return 0; }