M
Modular•13mo ago
Stijn

redefinition of symbol named '$< ... >'

A compiler error that took me a while to figure out. So happy to share how to solve this. Error:
./dainemo/utils/activations.mojo:0:0: error: redefinition of symbol named '$activations'
./dainemo/utils/activations.mojo:0:0: note: see current operation:
"lit.file_module"() ({
^bb0:
}) {sym_name = "$activations"} : () -> ()
./dainemo/nn/activations.mojo:0:0: note: see existing symbol definition here
./dainemo/utils/activations.mojo:0:0: error: redefinition of symbol named '$activations'
./dainemo/utils/activations.mojo:0:0: note: see current operation:
"lit.file_module"() ({
^bb0:
}) {sym_name = "$activations"} : () -> ()
./dainemo/nn/activations.mojo:0:0: note: see existing symbol definition here
Caused by empty files in a mojo module
mymodule/
__init__.mojo
activations.mojo --> empty file
mymodule/
__init__.mojo
activations.mojo --> empty file
Even if you delete the activations.mojo file now the compiler gets stuck in the same error. So you have to first clear the compiler cache: delete ~/.modular/.mojo_cache
4 Replies
gryznar
gryznar•13mo ago
Maybe it will be better to report this as a bug? Btw, same happened to me with cache not cleared, so definitely, there is a problem with that
Stijn
StijnOP•13mo ago
Yeah i might do that
Stijn
StijnOP•13mo ago
GitHub
[BUG]: redefinition of symbol named '$< ... >' · Issue #1140 · modu...
Bug description A compiler error that took me a while to figure out how to work around it. Error: ./dainemo/utils/activations.mojo:0:0: error: redefinition of symbol named '$activations' ./...
gryznar
gryznar•13mo ago
Great, thank you 🙂
Want results from more Discord servers?
Add your server