-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import statement does not follow identifier equality rules #18476
Comments
The But if However, if |
!nim c import parseUtils # works
import std/strUtils # fails
import seq_utils # fails |
🐧 Linux bisect by @c-blake (contributor)devel 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTstable 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST2.0.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST2.0.0 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.6.20 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.4.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.2.18 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTStats
🤖 Bug found in |
!nim c import seq_utils Repeated but simplified just to show the non- |
🐧 Linux bisect by @c-blake (contributor)devel 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTstable 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST2.0.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST2.0.0 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.6.20 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.4.8 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.2.18 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
AST1.0.10 👎 FAILOutput
IRCompiled filesize0 (0 bytes)
Stats
ASTStats
🤖 Bug found in |
Only needs to be documented, Nim first tries the name as written and then in all lowercase. |
It seems the |
sub-words as Nim behaves oddly there ( evidently intentionally as per nim-lang/Nim#18476 ).
The manual vaguely implies that module names should follow identifier equality rules (so, partial case-insensitivity and underscore is ignored).
https://nim-lang.org/docs/manual.html#modules
https://nim-lang.org/docs/manual.html#lexical-analysis-identifier-equality
But it appears that import statements treat
foobar
,foo_bar
, orfooBar
as different modules.Example
Current Output
Expected Output
Normal compilation conforming to identifier equality.
Possible Solution
If I am mistaken about the idea that import statement should follow identifier equality rules, it would be helpful if it was reflected in the manual. Otherwise there is a bug in the import statement.
Additional Information
Original discussion: Vladar4/sdl2_nim#35 (comment)
The text was updated successfully, but these errors were encountered: