E01010: invalid reference naming; module scope name missing
What went wrong
References must include the module qualifier with '::' separator. You cannot use a bare type name in the references section.
Worked examples
Compilable examples demonstrating this error and the correct fix:
- ek9 -q 851 (Why do references need a module qualifier with :: in EK9?)
Syntax
Format: module.path::SymbolName
The '::' separator divides:
- LEFT side: Module path (e.g., net.customer.pair)
- RIGHT side: Symbol name (e.g., MyClass, myFunction, MY_CONSTANT)
Module paths can be any depth (a.b, a.b.c, a.b.c.d). Note that similarly named modules have no hierarchical relationship - they are separate modules.
Usage
Once referenced, use the short name in code: the [EXAMPLE] section below references 'error.e01010.good.shapes::Circle' and then constructs a plain 'Circle(1.0)'. A name that is not referenced can still be written fully qualified at the point of use ('net.customer.pair::Other()').
How to fix it
- Add the module path before '::' for each reference
- Ensure references are alphabetically ordered (see E11026)
See also
Examples
Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.
Fails with E01010: invalid reference naming; module scope name missing
#!ek9 defines module error.e01010.bad references Circle defines function unitCircle() <- shape as Circle: Circle(1.0)
Fixed: Reference the type with its module name: module::Type
#!ek9 defines module error.e01010.good references error.e01010.good.shapes::Circle defines function unitCircle() <- shape as Circle: Circle(1.0)
Fixed: The module that defines Circle
#!ek9 defines module error.e01010.good.shapes defines class Circle radius as Float: 0.0 Circle() -> initialRadius as Float radius :=: initialRadius area() <- rtn as Float: radius * radius * 3.14159 default operator ?
Questions and answers
These Q&A entries show E01010 and its fix: