Skip to content

Allow recursive imports (if two files import from each other different components/globals/enums) #8875

@Rajala1404

Description

@Rajala1404

Bug Description

If two file import different things from each other the compiler throws an recursive import error.

  error: Recursive import of "/home/rajala1404/Development/lanis-desktop/ui/app/main-window.slint"
   --> /home/rajala1404/Development/lanis-desktop/ui/login/account-manager-page.slint:4:32
    |
  4 | import { MainWindowData } from "../app/main-window.slint";
    |                                ^

Is this intended behavior?

Reproducible Code (if applicable)

// "u.slint"

import { Toast } from "t.slint";

export component U inherits Window { }

// "t.slint"

import { U } from "u.slint";

export global Toast { }

Environment Details

  • Slint Version: 1.12.1
  • Platform/OS: Hyprland (Wayland) on Arch Linux (x86_64)
  • Programming Language: Rust
  • Backend/Renderer: Qt

Product Impact

I'm building an cross platform Desktop App for Lanis (The name of the Schoolportal in Hesse, Germany) because we currently only had an Mobile app (in Flutter) and multiple People (including me) wanted an Desktop app so here we are.
This is still early development so this is not a critical issue just an inconvenience because I would need to move every global into its own file to prevent that (or everything into one file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    a:language-slintCompiler for the .slint language (mO,bF)priority:lowLowest priority. The issue is kept open for tracking purpose, but noone is actively working on this

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions