aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlcompiler/qqmljsfunctioninitializer.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2022-02-16 13:33:47 +0100
committerUlf Hermann <ulf.hermann@qt.io>2022-02-24 12:16:41 +0100
commit282c4eaf9327470f05e0f2822eac8fa86f2be994 (patch)
tree31b842c639e4f25767d347ec02002dae5093e12a /src/qmlcompiler/qqmljsfunctioninitializer.cpp
parent78e3b774ad2a29e5d29029935661c362ee7e1a92 (diff)
QmlCompiler: Prepare QQmlJSTypeResolver for in-place type manipulation
We need quite a few more methods for this. The methods will be taken into use in follow up changes. Change-Id: I94e9f5b5fb3da277d90ea040b0219585ba6df397 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
-rw-r--r--src/qmlcompiler/qqmljsfunctioninitializer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/qmlcompiler/qqmljsfunctioninitializer.cpp b/src/qmlcompiler/qqmljsfunctioninitializer.cpp
index 4687c6bc0b..77f2894b91 100644
--- a/src/qmlcompiler/qqmljsfunctioninitializer.cpp
+++ b/src/qmlcompiler/qqmljsfunctioninitializer.cpp
@@ -92,15 +92,16 @@ 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->tracked(type));
+ function->argumentTypes.append(m_typeResolver->trackedType(type));
} else {
function->argumentTypes.append(
- m_typeResolver->tracked(m_typeResolver->varType()));
+ m_typeResolver->trackedType(m_typeResolver->varType()));
signatureError(u"Cannot resolve the argument type %1."_qs
.arg(argument.typeAnnotation->type->toString()));
}
} else {
- function->argumentTypes.append(m_typeResolver->tracked(m_typeResolver->varType()));
+ function->argumentTypes.append(m_typeResolver->trackedType(
+ m_typeResolver->varType()));
signatureError(u"Functions without type annotations won't be compiled"_qs);
}
}