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

Unexpected warning about a component being neither used nor exported #7176

Closed
hunger opened this issue Dec 19, 2024 · 2 comments · Fixed by #7261
Closed

Unexpected warning about a component being neither used nor exported #7176

hunger opened this issue Dec 19, 2024 · 2 comments · Fixed by #7261
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working

Comments

@hunger
Copy link
Member

hunger commented Dec 19, 2024

Bug Description

I get a warning in my slint code that I do not expect:

Component is neither used nor exported [Ln 1, Col 1]

Reproducible Code (if applicable)

component Foo /* Foo 1 */ { }

export component FooBaz {
    Foo /* <- TEST_ME_1 */ { }
}

component Foo /* Foo 2 */ { }

export component Baz {
    Foo /* <- TEST_ME_2 */ { }
}

Environment Details

  • Slint Version: master
  • Platform/OS: Linux
  • Programming Language: Not applicable
  • Backend/Renderer: Not applicable

Product Impact

Tiny :-)

@hunger hunger added bug Something isn't working need triaging Issue that the owner of the area still need to triage labels Dec 19, 2024
@tronical
Copy link
Member

I guess it should be an error that Foo is already defined?

@ogoffart
Copy link
Member

Funny thing is that if we do NOT use Foo 1 (by commenting the line with TEST_ME_1), then we don't get that warning.

@ogoffart ogoffart added a:compiler Slint compiler internal (not the codegen, not the parser) and removed need triaging Issue that the owner of the area still need to triage labels Jan 2, 2025
ogoffart added a commit that referenced this issue Jan 2, 2025
Also fix the unused component warning when that happens
Fixes #7176

ChangeLog: Warning when a type name overwrite another
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:compiler Slint compiler internal (not the codegen, not the parser) bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants