slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.71k stars 614 forks source link

Crashes, when opening preview when before popup was opened #4035

Closed qarmin closed 1 year ago

qarmin commented 1 year ago

Slint nightly/1.3.1 LSP

CODE

Panic

thread 'main' panicked at internal/compiler/namedreference.rs:48:34:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:127:5
   3: i_slint_compiler::namedreference::NamedReference::element
   4: slint_interpreter::eval::eval_expression
   5: slint_interpreter::dynamic_item_tree::make_binding_eval_closure::{{closure}}
   6: i_slint_core::properties::alloc_binding_holder::evaluate
   7: i_slint_core::properties::Property<T>::get
   8: <i_slint_core::rtti::MaybeAnimatedPropertyInfoWrapper<Item,i_slint_core::properties::Property<T>> as i_slint_core::rtti::PropertyInfo<Item,Value>>::get
   9: slint_interpreter::eval::load_property_helper
  10: slint_interpreter::eval::eval_expression
  11: slint_interpreter::eval::eval_expression
  12: slint_interpreter::eval::eval_expression
  13: slint_interpreter::dynamic_item_tree::make_binding_eval_closure::{{closure}}
  14: i_slint_core::properties::alloc_binding_holder::evaluate
  15: i_slint_core::properties::Property<T>::get
  16: <i_slint_core::rtti::MaybeAnimatedPropertyInfoWrapper<Item,i_slint_core::properties::Property<T>> as i_slint_core::rtti::PropertyInfo<Item,Value>>::get
  17: slint_interpreter::eval::load_property_helper
  18: slint_interpreter::dynamic_item_tree::item_geometry::{{closure}}
  19: slint_interpreter::dynamic_item_tree::item_geometry
  20: i_slint_core::item_rendering::ItemRenderer::filter_item
  21: i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitorVTable::new::visit_item
  22: i_slint_core::item_tree::visit_item_tree::{{closure}}
  23: slint_interpreter::dynamic_item_tree::visit_children_item
  24: i_slint_core::item_tree::ItemVisitor_vtable_mod::ItemVisitorVTable::new::visit_item
  25: i_slint_core::item_tree::visit_item_tree::{{closure}}
  26: slint_interpreter::dynamic_item_tree::visit_children_item
  27: i_slint_renderer_femtovg::FemtoVGRenderer::internal_render_with_post_callback::{{closure}}
  28: <i_slint_backend_winit::renderer::femtovg::GlutinFemtoVGRenderer as i_slint_backend_winit::renderer::WinitCompatibleRenderer>::render
  29: i_slint_backend_winit::event_loop::EventLoopState::process_event
  30: i_slint_backend_winit::event_loop::EventLoopState::run
  31: <i_slint_backend_winit::Backend as i_slint_core::platform::Platform>::run_event_loop
  32: slint_lsp::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Info  - 8:21:19 PM] Connection to server got closed. Server will restart.
true
The Slint Language Server crashed. This is a bug.
Please open an issue on https://github.com/slint-ui/slint/issues

Happens in vscode and web editor

https://github.com/slint-ui/slint/assets/41945903/a3916690-9044-40b9-95f2-4dbc97bbb026

ogoffart commented 1 year ago

As usual, thanks a lot for your bug report. I can reproduce the problem.