{"record":{"id":"58f3004e97eb4120","repo":"slint-ui/slint","slug":"itemmemberfunctioncall-prop-name","errorCode":null,"errorMessage":"ItemMemberFunctionCall `{prop_name}`","messagePattern":"ItemMemberFunctionCall `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/interpreter/eval.rs","lineNumber":2688,"sourceCode":"        );\n    }\n    if let Some(menu) = vtable::VRef::downcast_pin::<ContextMenu>(item_rc.borrow()) {\n        dispatch!(menu, prop_name.as_str();\n            \"close\" => close => (),\n            \"is-open\" => is_open,\n        );\n    }\n    if let Some(window) = vtable::VRef::downcast_pin::<WindowItem>(item_rc.borrow()) {\n        match prop_name.as_str() {\n            \"hide\" => {\n                window.hide(&adapter, &item_rc);\n                return Value::Void;\n            }\n            \"close\" => return Value::Bool(window.close(&adapter, &item_rc)),\n            _ => {}\n        }\n    }\n    unimplemented!(\"ItemMemberFunctionCall `{prop_name}`\")\n}\n","sourceCodeStart":2670,"sourceCodeEnd":2690,"githubUrl":"https://github.com/slint-ui/slint/blob/a9ea814a5813e7460fa1a867924872095a4d678d/internal/interpreter/eval.rs#L2670-L2690","documentation":"In the interpreter (used by slint-viewer, the LSP live preview, slintpad and the dynamic APIs), calling a member function on an item is evaluated by eval.rs, which implements only WindowItem.hide() and WindowItem.close(). Any other item member-function call in the markup reaches `unimplemented!(\"ItemMemberFunctionCall `{prop_name}`\")` and panics at evaluation time.","triggerScenarios":"A .slint file invoking an item member function other than window hide/close — e.g. focus()/grab-focus-style calls on input items — while running through an interpreter-based tool (slint-viewer path/to/file.slint, VS Code preview, slintpad, or load_str from Python/Node).","commonSituations":"Markup written for a newer Slint release using new member functions, previewed with an older viewer/LSP; using interpreter contexts to test UI that relies on member functions only the compiled code path supports.","solutions":["Restrict member-function calls to `window.hide()` / `window.close()` in markup that must run under the interpreter.","Verify behavior in a compiled build (Rust/cargo build of the app) instead of the interpreter preview.","Update slint-viewer / VS Code extension / slintpad to the version whose interpreter implements that member function.","If missing on the latest release, report it upstream with the prop_name from the panic."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"# Lint: interpreter contexts support only window hide/close member calls\nimport re, sys\nallowed = {\"hide\", \"close\"}\nfor path in sys.argv[1:]:\n    for m in re.finditer(r\"\\b([A-Za-z_][\\w-]*)\\s*\\.\\s*(\\w+)\\s*\\(\", open(path).read()):\n        obj, fn = m.groups()\n        if fn in {\"focus\", \"grab_focus\"} or (fn in allowed and obj not in {\"root\", \"window\"} and fn not in allowed):\n            print(f\"{path}: member function '{obj}.{fn}()' may be unsupported by the interpreter\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["In markup destined for slint-viewer/LSP preview, restrict member-function calls to window.hide()/window.close().","Verify full behavior in a compiled (Rust) build, not only the interpreter preview.","Keep viewer/editor/interpreter and compiler versions aligned."],"tags":["interpreter","eval","member-function","panic","live-preview"],"backgroundTag":"interpreter-unsupported-expression","analyzedSha":"a9ea814a5813e7460fa1a867924872095a4d678d","analyzedAt":"2026-08-16T22:39:12.830Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}