The section on Top-level items in the WIT spec mentions toplevel use items, that are supposed to be the top-level items you can find in a WIT file. However, according to the grammar, toplevel-use-item can also be included inside nested packages. And now I wonder if that would actually be valid and that toplevel-use-item should be read as packagelevel-use-item, or if there is something wrong with the grammar. Anyone?
Good point, I think you're right that the toplevel-use-item production should be renamed to packagelevel-use-item. (IIRC toplevel-use-item predates the addition of nested packages and so we just missed updating the name.)
Last updated: Dec 06 2025 at 05:03 UTC