aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2021-11-29 12:24:26 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2021-12-02 11:04:40 +0000
commit0e696e19fe42043720031f2421c15d76da192e19 (patch)
tree3b1c409a435ccba22a79f92730d8f974b48f9192
parente1370a01ff14b71adc9d601be6621851be2ac357 (diff)
QmlJsCheck: Allow new connection syntax in Connections
Change-Id: Ibbef3f8e8230d727d3183fa1615e0f38373a3c7f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/libs/qmljs/qmljscheck.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp
index f280b53c01..21c501791c 100644
--- a/src/libs/qmljs/qmljscheck.cpp
+++ b/src/libs/qmljs/qmljscheck.cpp
@@ -1236,7 +1236,11 @@ bool Check::visit(FunctionExpression *ast)
}
}
- addMessage(ErrFunctionsNotSupportedInQmlUi, locationFromRange(locfunc, loclparen));
+ const bool isDirectInConnectionsScope =
+ (!m_typeStack.isEmpty() && m_typeStack.last() == "Connections");
+
+ if (!isDirectInConnectionsScope)
+ addMessage(ErrFunctionsNotSupportedInQmlUi, locationFromRange(locfunc, loclparen));
DeclarationsCheck bodyCheck;
addMessages(bodyCheck(ast));