From 1003626e6ac98bc2a1eb0d2ed5df8727612f37ae Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 1 Dec 2021 19:05:51 +0100 Subject: QmlCompiler: Fix return type calculation We can return void from a function, explicitly or implicitly, and we need to be able to wrap that into a QVariant. In order to explicitly return void, we need the void type to be exposed and understood. Pick-to: 6.2 Change-Id: I513cabb25469b89a85b5d212a6825a037400729d Reviewed-by: Fabian Kosmale --- src/qmlcompiler/qqmljsfunctioninitializer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp') diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp index f7b2f26f04..0139071cc0 100644 --- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp +++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp @@ -107,7 +107,8 @@ void QQmlJSFunctionInitializer::populateSignature( if (ast->typeAnnotation) { function->returnType = m_typeResolver->typeFromAST(ast->typeAnnotation->type); if (!function->returnType) - signatureError(u"Cannot resolve return type"_qs); + signatureError(u"Cannot resolve return type %1"_qs.arg( + QmlIR::IRBuilder::asString(ast->typeAnnotation->type->typeId))); } } -- cgit v1.2.3