Skip to main content

Module name

Module name 

Source
Expand description

Home to the Name and QualName primitives

Name is a generic identifier, which can be qualified (refers to a value/type and its module) or not. QualName is an identifier which have a reference to its module.

While Name is pretty useful during parsing (it let us have a generic, simple to manipulate, type), QualName is actually the identifier we want for every subsequent phases as we have to refer to the actual property of that identifier, and each identifier’s name is only unique within its own module.

Having a dedicated type let us enforce such distinction at compile time (as well as having a potential performance boost by not having to parse the underlying String on each access, although at the cost of more memory usage).

In the future, if performance requires it, this module will probably also host the interner for qualified and unqualified names.

Structs§

Name
new type over identifier names
QualName
Qualified name: a declaration, named by the package and the module that declare it.