slint-ui/slint · error

implemented type conversion {:#?}

Error message

implemented type conversion {:#?}

What it means

The compiler's Python code generator (internal/compiler/generator/python.rs) maps every public Type to a Python annotation name; a type outside the handled set panics with (sic) 'implemented type conversion {ty}' — the message is missing an 'un', it means unimplemented. The panic occurs at code-generation time, i.e. while producing Python code, not at runtime.

Source

Thrown at internal/compiler/generator/python.rs:710

        },
        Type::Enumeration(enumeration) => {
            if enumeration.node.is_some() {
                ident(&enumeration.name)
            } else {
                SmolStr::new_static("None")
            }
        }
        Type::Callback(function) | Type::Function(function) => {
            format_smolstr!(
                "typing.Callable[[{}], {}]",
                function.args.iter().map(python_type_name).join(", "),
                python_type_name(&function.return_type)
            )
        }
        Type::Keys => SmolStr::new_static("slint.Keys"),
        Type::DataTransfer => SmolStr::new_static("slint.DataTransfer"),
        Type::MouseCursor => SmolStr::new_static("None"),
        ty => unimplemented!("implemented type conversion {:#?}", ty),
    }
}

View on GitHub (pinned to a9ea814a58)

Solutions

  1. Remove the offending type from the component's public API (don't export it as property/callback/function); keep it internal.
  2. Update to a slint version whose Python generator handles the type.
  3. Report upstream with the type printed in the panic message ('implemented type conversion <ty>').
Defensive patterns

Strategy: validation

Validate before calling

# CI step: run the Python code generation over all .slint files; a panic fails the build
set -e
for f in $(find ui -name '*.slint'); do
  slint-compiler --language python "$f" > /dev/null
done

Prevention

When it happens

Trigger: Generating Python output (slint-compiler --language python or the Python build pipeline) from .slint whose exported properties/callbacks/functions use a type python_type_name cannot name, e.g. easing- or path-data-typed public API.

Common situations: A new type added to the compiler before generator support catches up; internal types leaking into a component's public signature; generated-code CI suddenly failing after a compiler update.

Related errors


AI-assisted analysis of slint-ui/slint@a9ea814a58 (2026-08-16). Data as JSON: /api/errors/fa42221dfc8214ae. Report an issue: GitHub.