diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-25 11:01:17 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-03 13:35:48 +0100 |
commit | 8272eef2d736351d2ba41590680da395647a874e (patch) | |
tree | 41f2d906b84fd2ae2394a3414b3ce0d82cbd8dbc /src | |
parent | cf3534147f55ec5f3e5af1f206122c1a5b96ddd4 (diff) |
QmlCompiler: Correctly label return types of JS functions
Returning void from any JS function doesn't quite cut it.
Fixes: QTBUG-101285
Change-Id: I199813627614061ec25139277e8ea23cb844aac5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
(cherry picked from commit 23ab2e0f5552bb54fef5a6c57f5f82f430d0956c)
Diffstat (limited to 'src')
-rw-r--r-- | src/qmlcompiler/qqmljstypepropagator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qmlcompiler/qqmljstypepropagator.cpp b/src/qmlcompiler/qqmljstypepropagator.cpp index 6222b8acb1..5945aa4584 100644 --- a/src/qmlcompiler/qqmljstypepropagator.cpp +++ b/src/qmlcompiler/qqmljstypepropagator.cpp @@ -906,7 +906,9 @@ void QQmlJSTypePropagator::propagateCall(const QList<QQmlJSMetaMethod> &methods, return; } - const auto returnType = match.returnType(); + const auto returnType = match.isJavaScriptFunction() + ? m_typeResolver->jsValueType() + : QQmlJSScope::ConstPtr(match.returnType()); m_state.accumulatorOut = m_typeResolver->globalType( returnType ? QQmlJSScope::ConstPtr(returnType) : m_typeResolver->voidType()); if (!m_state.accumulatorOut.isValid()) |