Skip to content
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

Lint/style error reported for explicit module name when there's a type collision #12955

Closed
snluu opened this issue Dec 23, 2019 · 3 comments
Closed

Comments

@snluu
Copy link

snluu commented Dec 23, 2019

Example

# fileinfo.nim
type FileInfo* = object
# main.nim
import os
import fileinfo

# This next line has name collision
# var xs: seq[FileInfo]

# This next line causes the linter to bark
var xs: seq[fileinfo.FileInfo]

Current Output

main.nim(9, 21) Hint: 'fileinfo' should be: 'FileInfo'

Possible Solution

Alias the module to something else that the linter won't bark at (such as fi)

Version:

$ nim -v
Nim Compiler Version 1.0.4 [MacOSX: amd64]
@ghost ghost added the Nim Check label Oct 22, 2020
@ringabout
Copy link
Member

ringabout commented Mar 29, 2021

I can't reproduce this issue on Linux and Windows with nim check,

@timotheecour
Copy link
Member

timotheecour commented Mar 29, 2021

@xflywind problem is still there, you need to pass --stylecheck:hint or --stylecheck:error

as of 861c42c 1.5.1

@ringabout
Copy link
Member

Works on devel, it is probably fixed by #19356

ringabout added a commit that referenced this issue Aug 14, 2022
ringabout added a commit that referenced this issue Aug 15, 2022
* Improve error message for `strutils.addf` (#20157)

Co-authored-by: ringabout <[email protected]>

* fixes #20153; do not escape `_` for mysql [backport] (#20164)

* fixes #20153; do not escape `_` for mysql

* add a test

* Update db_mysql.nim

* Update tdb_mysql.nim

Co-authored-by: Clay Sweetser <[email protected]>

* [minor] don't find `"Hint: gc"` for action (#20170)

* fixes links in the readme (#20167)

* update the docs of arc following up #19749 (#19752)

Co-authored-by: flywind <[email protected]>

* fixes broken ssl tests (#20181)

* bootstrap the compiler with nimPreviewSlimSystem (#20176)

* bootstrap the compiler with nimPreviewSlimSystem

* threads

* docs: fix some spelling errors (#19816)

* docs: fix some spelling errors

* contributing: fix spelling error

Co-authored-by: konsumlamm <[email protected]>

* Update contributing.md

* Update intern.md

* Update manual.md

* Update manual_experimental_strictnotnil.md

* Update nimgrep_cmdline.txt

* Update pegdocs.txt

* Update testament.md

* Update tut1.md

Co-authored-by: konsumlamm <[email protected]>
Co-authored-by: Clay Sweetser <[email protected]>

* Build compiler with --noNimblePath (#20168)

- Fixes #18840

* help our poor CI; don't run CI on other branches for push (#20184)

* fix broken runnableExamples for getWeeksInIsoYear (#20193)

Based on what I understand from [Wikipedia](https://en.wikipedia.org/wiki/ISO_week_date#Weeks_per_year), 2001 does not have 53 weeks, but 2004, 2009, 2015, 2020 do. The years 2000 and 2001 seem to be copy pasted from the `getDaysInYear` example above. The result of `getWeeksInIsoYear` also seem to match up with Wikipedia.

That means these runnableExamples were never tested. Why is this the case? I only discovered this in #20091.

* improve deprecation error messages (#20197)

* Show beatutiful html instead of ugly markdown preview (#20196)

* closes #6559; add testcase (#20200)

* CI upgrade to ubuntu-20.04 (#20182)

* CI upgrade to ubuntu-20.04 

The ubuntu-18.04 environment is deprecated, consider switching to ubuntu-20.04(ubuntu-latest), or ubuntu-22.04 instead. For more details see actions/runner-images#6002

* Update azure-pipelines.yml

* Markdown code blocks part 4 (#20189)

No logic was added, just 8 more files have been migrated.

* closes #15316; add testcase (#20213)

* add version-1-6 and version-1-2 to triggered branches (#20214)

* add version-1-6 and version-1-2 to triggered branches

* Update .github/workflows/ci_packages.yml

* use quote

* closes #12955; add testcase (#20223)

* add more

Co-authored-by: konsumlamm <[email protected]>
Co-authored-by: Clay Sweetser <[email protected]>
Co-authored-by: flywind <[email protected]>
Co-authored-by: ee7 <[email protected]>
Co-authored-by: Ivan Yonchovski <[email protected]>
Co-authored-by: metagn <[email protected]>
Co-authored-by: Andrey Makarov <[email protected]>
capocasa pushed a commit to capocasa/Nim that referenced this issue Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants