An importer is given the pub forms and nothing else, so a pub form naming a private type, or one from an import without pub, compiled in its module and failed in every importer with `unknown type name'. The pub forms are checked as the module itself is compiled. A record, struct, union or sum behind a pointer needs only declaring, so its bodyless declaration goes out ahead of them -- the opaque handle that (pub record T) already gave by hand. Held by value it needs its body, and a typedef or an enum has no declaration short of its definition: those are errors at the pub form, saying what would do instead. A name Sex has no declaration for is left to C. An importer may now be handed a declaration after the definition it declares, so a bodyless aggregate no longer replaces known fields. Fixes #57, #58.
29 KiB
29 KiB