You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to import echo from the system module under the alias my_echo, I get this error:
c:\Users\Obround\Desktop\Nim_tests\my_test.nim(1, 25) Error: identifier expected, but found 'echo as my_echo'
This is my code:
from system import echo as my_echo
my_echo"Hello World"
I believe this error is happening because the compiler thinks I want to echo an output instead of alias it. Is this a bug, or am I doing something incorrect (I think its a bug)?
The text was updated successfully, but these errors were encountered:
It seems like echo is treated as a keyword when parsing and only the following structure is allowed from [module identifier] import [identifier] as [identifier].
That's not how as works, you can only use as to alias module names, not arbitrary identifiers. And for modules this feature only exists to allow for multiple modules of the same name to be imported.
When I try to import
echo
from thesystem
module under the aliasmy_echo
, I get this error:This is my code:
I believe this error is happening because the compiler thinks I want to echo an output instead of alias it. Is this a bug, or am I doing something incorrect (I think its a bug)?
The text was updated successfully, but these errors were encountered: