{"record":{"id":"4021b16db0d598bf","repo":"slint-ui/slint","slug":"component-factory-not-yet-supported-in-c","errorCode":null,"errorMessage":"component-factory not yet supported in C++","messagePattern":"component-factory not yet supported in C\\+\\+","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/compiler/generator/cpp.rs","lineNumber":4922,"sourceCode":"            sub_expression,\n            ctx,\n        ),\n        Expression::MinMax { ty, op, lhs, rhs } => {\n            let ident = match op {\n                MinMaxOp::Min => \"min\",\n                MinMaxOp::Max => \"max\",\n            };\n            let lhs_code = compile_expression(lhs, ctx);\n            let rhs_code = compile_expression(rhs, ctx);\n            format!(\n                r#\"std::{ident}<{ty}>({lhs_code}, {rhs_code})\"#,\n                ty = ty.cpp_type().unwrap_or_default(),\n                ident = ident,\n                lhs_code = lhs_code,\n                rhs_code = rhs_code\n            )\n        }\n        Expression::EmptyComponentFactory => panic!(\"component-factory not yet supported in C++\"),\n        Expression::EmptyDataTransfer => \"slint::DataTransfer()\".into(),\n        Expression::TranslationReference { format_args, string_index, plural } => {\n            let args = compile_expression(format_args, ctx);\n            match plural {\n                Some(plural) => {\n                    let plural = compile_expression(plural, ctx);\n                    format!(\n                        \"slint::private_api::translate_from_bundle_with_plural(slint_translation_bundle_plural_{string_index}_str, slint_translation_bundle_plural_{string_index}_idx,  slint_translated_plural_rules, {args}, {plural})\"\n                    )\n                }\n                None => format!(\n                    \"slint::private_api::translate_from_bundle(slint_translation_bundle_{string_index}, {args})\"\n                ),\n            }\n        }\n        Expression::Closure { arg_name, expression } => {\n            let arg = ident(arg_name);\n            let expr = compile_expression(expression, ctx);","sourceCodeStart":4904,"sourceCodeEnd":4940,"githubUrl":"https://github.com/slint-ui/slint/blob/3a7e700487dc74d404cad0726378053ab763d4e0/internal/compiler/generator/cpp.rs#L4904-L4940","documentation":"The C++ generator's expression compiler hit an Expression::ComponentFactory value while lowering to C++ code. Component-factory values (used for dynamic component instantiation features in other backends) are not implemented in the C++ code generator, so compilation of the .slint file fails with this message. It fires when a .slint program uses a feature that produces a component factory (e.g. certain @children / repeated component references) and targets the C++ API.","triggerScenarios":"Thrown at internal/compiler/generator/cpp.rs:4928 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Avoid component-factory typed properties/callbacks in .slint code compiled for the C++ generator; restructure to pass components differently","Implement the component-factory codegen path in internal/compiler/generator/cpp.rs if C++ support is required","Use a workaround such as storing the component as a plain element instance instead of a factory"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a7e700487dc74d404cad0726378053ab763d4e0","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}