Open fmease opened 3 years ago
Btw, what happens with this code?:
;;; escape.lushui:
@(public self.escape) module
Can one access the component name this way??
This appears to be fixed since we disallow @public
on module headers:
error[E013]: attribute `public` is ascribed to a module header declaration
--> /home/fmease/programming/main_projects/lushui/component-name.lushui:1:1
|
1 | @(public self.component-name)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ misplaced attribute
|
--> /home/fmease/programming/main_projects/lushui/component-name.lushui:2:1
|
2 | module
| ------ incompatible item
|
note: attribute `public` can only be ascribed to declarations except constructors and module headers
Leaving this issue open since we should document this in the code (that the specific AttributeTargets
where chosen to prevent restricting the exposure of the component root).
The component root is implicitly public (i.e. has unrestricted exposure). Thus, the following should stay legal:
But code like the one below should not be legal:
The check could of course be implemented in the lowerer but I'd rather do it in the name resolver.
Not sure if we should check this during lowering or in the name resolver. Probably in the name resolver.