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

slint-build: Multiple exports are silently ignored #4437

Closed
DoumanAsh opened this issue Jan 26, 2024 · 1 comment
Closed

slint-build: Multiple exports are silently ignored #4437

DoumanAsh opened this issue Jan 26, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@DoumanAsh
Copy link

DoumanAsh commented Jan 26, 2024

export component Main2 inherits Window {
}

export component Main1 inherits Window {
}

Then given the following code:

slint::include_modules!();

fn main {
    let main = Main1::new().expect("Create UI");
    let main = Main2::new().expect("Create UI");
}

I get error:

  --> src/main.rs:14:16
   |
14 |     let main = Main2::new().expect("Create UI");
   |                ^^^^^
   |                |
   |                use of undeclared type `Main2`
   |                help: a struct with a similar name exists: `Main1`

Then If I change order to have Main1 as first component, then error will be reversed.
So it seems inline export of component actually gets overshadowed by builder as I checked generated code and there is no declaration of second component

I'm not sure if it is intended behavior, but it seems to be quite error prone and probably should be clarified (error out if second export overshadows another export)

@ogoffart
Copy link
Member

Thanks for filling a bug.

This is a duplicate of #784

@ogoffart ogoffart closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
@ogoffart ogoffart added the duplicate This issue or pull request already exists label Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants