diff options
| author | Ulf Hermann <ulf.hermann@qt.io> | 2022-02-21 17:35:44 +0100 |
|---|---|---|
| committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-03-03 18:44:21 +0100 |
| commit | 4679710f4d9d44605fa55022d8d6d2fd19d7176a (patch) | |
| tree | a305eacf6eaa34488af181b89f364eaf1027cc22 /src/qmlcompiler/qqmljsfunctioninitializer.cpp | |
| parent | 8dd7201994c41a5adb8f26a43509fd0dab031bf7 (diff) | |
QmlCompiler: Store arguments as QQmlJSRegisterContent
This way we can uniquely track the stored types throughout the
compilation.
Change-Id: Ibf3814a37f105c2eede2a08f547ab5fbfa1c16e2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmlcompiler/qqmljsfunctioninitializer.cpp')
| -rw-r--r-- | src/qmlcompiler/qqmljsfunctioninitializer.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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); } } |
