From 1b0d82b80c43a13db694eb477d6b80d7ceca4314 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 16 Oct 2023 09:17:42 +0200 Subject: QtQml: Register function type annotations as mandatory type references If they can't be resolved, we cannot continue. Pick-to: 6.2 Fixes: QTBUG-117788 Change-Id: Id3e81853f802419f1121ef5e856c3272a3c977a1 Reviewed-by: Fabian Kosmale Reviewed-by: Qt CI Bot (cherry picked from commit bf2258e6f44f1279eee5e9c2dd595c5dd2020784) (cherry picked from commit ae9f6b1743ab94a7509b3a77f60e110cde2016a1) Reviewed-by: Sami Shalayel --- src/qml/compiler/qv4compiler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/qml/compiler/qv4compiler.cpp') diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index e6146d515b..eda3a52a79 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -470,8 +470,9 @@ void QV4::Compiler::JSUnitGenerator::writeFunction(char *f, QV4::Compiler::Conte for (int i = 0; i < irFunction->arguments.size(); ++i) { auto *formal = &formals[i]; formal->nameIndex = getStringId(irFunction->arguments.at(i).id); - if (QQmlJS::AST::TypeAnnotation *annotation = irFunction->arguments.at(i).typeAnnotation.data()) - QmlIR::Parameter::initType(&formal->type, idGenerator, annotation->type); + QQmlJS::AST::TypeAnnotation *annotation = irFunction->arguments.at(i).typeAnnotation.data(); + QmlIR::Parameter::initType( + &formal->type, idGenerator, annotation ? annotation->type : nullptr); } // write locals -- cgit v1.2.3