From 4679710f4d9d44605fa55022d8d6d2fd19d7176a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 21 Feb 2022 17:35:44 +0100 Subject: QmlCompiler: Store arguments as QQmlJSRegisterContent This way we can uniquely track the stored types throughout the compilation. Change-Id: Ibf3814a37f105c2eede2a08f547ab5fbfa1c16e2 Reviewed-by: Fabian Kosmale --- src/qmlcompiler/qqmljsfunctioninitializer.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp') diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp index 77f2894b91..c993197399 100644 --- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp +++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp @@ -92,16 +92,20 @@ void QQmlJSFunctionInitializer::populateSignature( for (const QQmlJS::AST::BoundName &argument : qAsConst(arguments)) { if (argument.typeAnnotation) { if (const auto type = m_typeResolver->typeFromAST(argument.typeAnnotation->type)) { - function->argumentTypes.append(m_typeResolver->trackedType(type)); + function->argumentTypes.append( + m_typeResolver->tracked( + m_typeResolver->globalType(type))); } else { function->argumentTypes.append( - m_typeResolver->trackedType(m_typeResolver->varType())); + m_typeResolver->tracked( + m_typeResolver->globalType(m_typeResolver->varType()))); signatureError(u"Cannot resolve the argument type %1."_qs .arg(argument.typeAnnotation->type->toString())); } } else { - function->argumentTypes.append(m_typeResolver->trackedType( - m_typeResolver->varType())); + function->argumentTypes.append( + m_typeResolver->tracked( + m_typeResolver->globalType(m_typeResolver->varType()))); signatureError(u"Functions without type annotations won't be compiled"_qs); } } -- cgit v1.2.3