Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Mar 6, 2025
1 parent a17c925 commit efdb96e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion internal/compiler/passes/resolving.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,10 @@ impl Expression {
return Self::Invalid;
};
let LookupResult::Callable(function) = function else {
ctx.diag.push_error("Callbacks can only be forwarded to callbacks and functions".into(), &node);
ctx.diag.push_error(
"Callbacks can only be forwarded to callbacks and functions".into(),
&node,
);
return Self::Invalid;
};

Expand Down
4 changes: 2 additions & 2 deletions internal/compiler/tests/syntax/basic/signal.slint
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export SubElements := Rectangle {
callback int_arg(bool, int);

callback abs(int) -> int;

TouchArea {
clicked => { foobar() }
}

TouchArea {
clicked => foobar;
}

TouchArea {
clicked => callback_with_arg;
// ^error{Cannot forward callback with 0 arguments to callback or function with 2 arguments}
Expand Down
5 changes: 4 additions & 1 deletion tools/lsp/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ fn lookup_expression_context(mut n: SyntaxNode) -> Option<ExpressionContextInfo>
break (element, prop_name, false);
}
match n.kind() {
SyntaxKind::Binding | SyntaxKind::TwoWayBinding | SyntaxKind::CallbackConnection | SyntaxKind::CallbackForwarding => {
SyntaxKind::Binding
| SyntaxKind::TwoWayBinding
| SyntaxKind::CallbackConnection
| SyntaxKind::CallbackForwarding => {
let mut parent = n.parent()?;
if parent.kind() == SyntaxKind::PropertyAnimation {
let prop_name = i_slint_compiler::parser::identifier_text(&n)?;
Expand Down

0 comments on commit efdb96e

Please sign in to comment.