Open and answer this issue on GitHub.
ready · opened 2026-10-13 · updated 2026-10-13 · 0 comments
ADR-347 (#608, fa6bd8a) lets Typ(x) stand for Typ::Variant(x) when Typ is an enum with exactly one variant. The build rewrites the short form right after parsing (crates/nikaia/src/one_variant.rs), and it only knows the enums of the same file and of std. An enum declared in another module of the program or in a package is not recognised yet, so the short form is refused there although the rule (Part I 3.4) applies to every enum.
use), e.g. by moving the rewrite to where module types are known, or by giving the rewrite the module’s enum table.packages/<name>/, dependencies).m::Wrap(x); a package enum used with the short form; NK1252 still fires for a two-variant enum from another module.