diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qmlcompiler/qqmljscodegenerator.cpp | 18 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljscompilepass_p.h | 2 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljsoptimizations.cpp | 2 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljsregistercontent.cpp | 23 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljsregistercontent_p.h | 113 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljstypepropagator.cpp | 26 | ||||
| -rw-r--r-- | src/qmlcompiler/qqmljstyperesolver.cpp | 28 |
7 files changed, 121 insertions, 91 deletions
diff --git a/src/qmlcompiler/qqmljscodegenerator.cpp b/src/qmlcompiler/qqmljscodegenerator.cpp index b3f2758b80..c215c130b3 100644 --- a/src/qmlcompiler/qqmljscodegenerator.cpp +++ b/src/qmlcompiler/qqmljscodegenerator.cpp @@ -686,7 +686,7 @@ void QQmlJSCodeGenerator::generate_LoadQmlContextPropertyLookup(int index) const int nameIndex = m_jsUnitGenerator->lookupNameIndex(index); const QString name = m_jsUnitGenerator->stringForIndex(nameIndex); - if (m_state.accumulatorOut().scopeType().contains(m_typeResolver->jsGlobalObject())) { + if (m_state.accumulatorOut().scope().contains(m_typeResolver->jsGlobalObject())) { // This produces a QJSValue. The QQmlJSMetaProperty used to analyze it may have more details // but the QQmlJSAotContext API does not reflect them. m_body += m_state.accumulatorVariableOut + u" = "_s @@ -935,7 +935,7 @@ void QQmlJSCodeGenerator::generateEnumLookup(int index) return; } - const QQmlJSScope::ConstPtr scopeType = m_state.accumulatorOut().scopeType().containedType(); + const QQmlJSScope::ConstPtr scopeType = m_state.accumulatorOut().scopeType(); // Otherwise we would have found an enum with values. Q_ASSERT(!scopeType->isComposite()); @@ -1143,7 +1143,7 @@ void QQmlJSCodeGenerator::generateWriteBack(int registerIndex) const QString writeBackIndexString = QString::number(lookupIndex); const QQmlJSRegisterContent::ContentVariant variant = writeBack.variant(); - if (variant == QQmlJSRegisterContent::Property && isQmlScopeObject(writeBack.scopeType())) { + if (variant == QQmlJSRegisterContent::Property && isQmlScopeObject(writeBack.scope())) { const QString lookup = u"aotContext->writeBackScopeObjectPropertyLookup("_s + writeBackIndexString + u", "_s + contentPointer(writeBack, writeBackRegister) + u')'; @@ -1177,7 +1177,7 @@ void QQmlJSCodeGenerator::generateWriteBack(int registerIndex) switch (writeBack.variant()) { case QQmlJSRegisterContent::Property: - if (writeBack.scopeType().containedType()->isReferenceType()) { + if (writeBack.scopeType()->isReferenceType()) { const QString lookup = u"aotContext->writeBackObjectLookup("_s + writeBackIndexString + u", "_s + outerRegister @@ -1197,7 +1197,7 @@ void QQmlJSCodeGenerator::generateWriteBack(int registerIndex) + u", "_s + contentPointer(writeBack, writeBackRegister) + u')'; const QString initialization = u"aotContext->initGetValueLookup("_s + writeBackIndexString - + u", "_s + metaObject(writeBack.scopeType().containedType()) + u')'; + + u", "_s + metaObject(writeBack.scopeType()) + u')'; generateLookup(lookup, initialization); } break; @@ -1361,7 +1361,7 @@ void QQmlJSCodeGenerator::generate_GetLookupHelper(int index) return; } - if (m_state.accumulatorOut().scopeType().contains(m_typeResolver->mathObject())) { + if (m_state.accumulatorOut().scope().contains(m_typeResolver->mathObject())) { QString name = m_jsUnitGenerator->lookupName(index); double value{}; @@ -1415,7 +1415,7 @@ void QQmlJSCodeGenerator::generate_GetLookupHelper(int index) ? QString::number(m_state.accumulatorIn().importNamespace()) : u"QQmlPrivate::AOTCompiledContext::InvalidStringId"_s; const auto accumulatorIn = m_state.accumulatorIn(); - const QQmlJSRegisterContent scope = m_state.accumulatorOut().scopeType(); + const QQmlJSRegisterContent scope = m_state.accumulatorOut().scope(); const bool isReferenceType = scope.containedType()->isReferenceType(); switch (m_state.accumulatorOut().variant()) { @@ -2236,7 +2236,7 @@ void QQmlJSCodeGenerator::generate_CallPropertyLookup(int index, int base, int a { INJECT_TRACE_INFO(generate_CallPropertyLookup); - const QQmlJSRegisterContent scopeContent = m_state.accumulatorOut().scopeType(); + const QQmlJSRegisterContent scopeContent = m_state.accumulatorOut().scope(); const QQmlJSScope::ConstPtr scope = scopeContent.containedType(); AccumulatorConverter registers(this); @@ -2337,7 +2337,7 @@ void QQmlJSCodeGenerator::generate_CallQmlContextPropertyLookup(int index, int a { INJECT_TRACE_INFO(generate_CallQmlContextPropertyLookup); - if (m_state.accumulatorOut().scopeType().contains(m_typeResolver->jsGlobalObject())) { + if (m_state.accumulatorOut().scope().contains(m_typeResolver->jsGlobalObject())) { const QString name = m_jsUnitGenerator->stringForIndex( m_jsUnitGenerator->lookupNameIndex(index)); if (inlineTranslateMethod(name, argc, argv)) diff --git a/src/qmlcompiler/qqmljscompilepass_p.h b/src/qmlcompiler/qqmljscompilepass_p.h index 3df8b3b3a6..b8ab0dc6f5 100644 --- a/src/qmlcompiler/qqmljscompilepass_p.h +++ b/src/qmlcompiler/qqmljscompilepass_p.h @@ -322,7 +322,7 @@ protected: case QQmlJSRegisterContent::ScopeObject: return content.contains(m_function->qmlScope.containedType()); case QQmlJSRegisterContent::ModulePrefix: - return content.scopeType().contains(m_function->qmlScope.containedType()); + return content.scope().contains(m_function->qmlScope.containedType()); default: break; } diff --git a/src/qmlcompiler/qqmljsoptimizations.cpp b/src/qmlcompiler/qqmljsoptimizations.cpp index 6827f10d82..177fa9083b 100644 --- a/src/qmlcompiler/qqmljsoptimizations.cpp +++ b/src/qmlcompiler/qqmljsoptimizations.cpp @@ -132,7 +132,7 @@ void QQmlJSOptimizations::populateReaderLocations() if (!access.trackedTypes.contains(origin)) continue; - Q_ASSERT(readIt->second.content.conversionResult()); + Q_ASSERT(readIt->second.content.conversionResultType()); access.typeReaders[blockInstr.key()] = readIt->second.content; break; } diff --git a/src/qmlcompiler/qqmljsregistercontent.cpp b/src/qmlcompiler/qqmljsregistercontent.cpp index 6f4e893ef8..dc74c1a0b2 100644 --- a/src/qmlcompiler/qqmljsregistercontent.cpp +++ b/src/qmlcompiler/qqmljsregistercontent.cpp @@ -251,7 +251,7 @@ QString QQmlJSRegisterContent::descriptiveName() const return u"import namespace %1"_s.arg(importNamespace()); } case Kind::Conversion: { - return u"conversion to %1"_s.arg(conversionResult()->internalName()); + return u"conversion to %1"_s.arg(conversionResultType()->internalName()); } case Kind::MethodCall: { const QQmlJSMetaMethod &method = std::get<QQmlJSMetaMethod>(d->m_content); @@ -269,7 +269,7 @@ QString QQmlJSRegisterContent::containedTypeName() const switch (variant()) { case QQmlJSRegisterContent::MetaType: - type = scopeType().containedType(); + type = scopeType(); break; default: type = containedType(); @@ -374,7 +374,7 @@ QQmlJSRegisterContent QQmlJSRegisterContent::attacher() const { Q_ASSERT(d); Q_ASSERT(d->m_variant == Attachment); - return scopeType(); + return scope(); } /*! @@ -386,9 +386,9 @@ QQmlJSRegisterContent QQmlJSRegisterContent::attachee() const { Q_ASSERT(d); Q_ASSERT(d->m_variant == Attachment); - QQmlJSRegisterContent attachee = attacher().scopeType(); + QQmlJSRegisterContent attachee = attacher().scope(); while (attachee.variant() == ModulePrefix) - attachee = attachee.scopeType(); + attachee = attachee.scope(); return attachee; } @@ -412,16 +412,16 @@ QQmlJSScope::ConstPtr QQmlJSRegisterContent::containedType() const if (isImportNamespace()) return importNamespaceType(); if (isConversion()) - return conversionResult(); + return conversionResultType(); if (isMethodCall()) return std::get<QQmlJSMetaMethod>(d->m_content).returnType(); Q_UNREACHABLE_RETURN({}); } -QQmlJSRegisterContent QQmlJSRegisterContent::scopeType() const +QQmlJSScope::ConstPtr QQmlJSRegisterContent::scopeType() const { - return d ? d->m_scope : QQmlJSRegisterContent(); + return d ? d->m_scope.containedType() : QQmlJSScope::ConstPtr(); } QQmlJSScope::ConstPtr QQmlJSRegisterContent::type() const @@ -483,7 +483,7 @@ QQmlJSScope::ConstPtr QQmlJSRegisterContent::importNamespaceType() const return std::get<std::pair<uint, QQmlJSScope::ConstPtr>>(d->m_content).second; } -QQmlJSScope::ConstPtr QQmlJSRegisterContent::conversionResult() const +QQmlJSScope::ConstPtr QQmlJSRegisterContent::conversionResultType() const { Q_ASSERT(isConversion()); return std::get<QQmlJSRegisterContentPrivate::ConvertedTypes>(d->m_content).result; @@ -512,6 +512,11 @@ QQmlJSRegisterContent::ContentVariant QQmlJSRegisterContent::variant() const return d ? d->m_variant : Unknown; } +QQmlJSRegisterContent QQmlJSRegisterContent::scope() const +{ + return d ? d->m_scope : QQmlJSRegisterContent(); +} + QQmlJSRegisterContent QQmlJSRegisterContent::storage() const { return d ? d->m_storage : QQmlJSRegisterContent(); diff --git a/src/qmlcompiler/qqmljsregistercontent_p.h b/src/qmlcompiler/qqmljsregistercontent_p.h index a8b8814b39..73745643e7 100644 --- a/src/qmlcompiler/qqmljsregistercontent_p.h +++ b/src/qmlcompiler/qqmljsregistercontent_p.h @@ -24,93 +24,118 @@ struct QQmlJSRegisterContentPrivate; class Q_QMLCOMPILER_EXPORT QQmlJSRegisterContent { public: + // ContentVariant determines the relation between this register content and its scope(). + // For example, a property is always a property of a type. That type is given as scope. + // Most content variants can carry either a specific kind of content, as commented below, + // or a conversion. If two or more register contents of the same content variant are merged, + // they retain their content variant but become a conversion with the original register + // contents linked as conversion origins. + enum ContentVariant { - ObjectById, - TypeByName, - Singleton, - Script, - MetaType, - Extension, - ScopeObject, - ParentScope, + ObjectById, // type (scope is QML scope of binding/function) + TypeByName, // type (TODO: scope is not guaranteed to be useful) + Singleton, // type (scope is either import namespace or QML scope) + Script, // type (scope is either import namespace or QML scope) + MetaType, // type (always QMetaObject, scope is the type reprented by the metaobject) + Extension, // type (scope is the type being extended) + ScopeObject, // type (either QML scope of binding/function or JS global object) + ParentScope, // type (scope is the child scope) + + Property, // property (scope is the owner (hasOwnProperty) of the property) + Method, // method (retrieved as property, including overloads), like property + Enum, // enumeration (scope is the type the enumeration belongs to) - Property, - Method, - Enum, + Attachment, // type (scope is attacher; use attacher() and attachee() for clarity) + ModulePrefix, // import namespace (scope is either QML scope or type the prefix is used on) - Attachment, - ModulePrefix, + MethodCall, // method call (resolved to specific overload), like property - MethodCall, + ListValue, // property (scope is list retrieved from) + ListIterator, // property (scope is list being iterated) - ListValue, - ListIterator, + Literal, // type (scope does not exist) + Operation, // type (scope does not exist) - Literal, - Operation, + BaseType, // type (scope is derived type) + Cast, // type (scope is type casted from) - BaseType, - Cast, + Storage, // type (scope does not exist) - Storage, - Unknown, + // Either a synthetic type or a merger of multiple different variants. + // In the latter case, look at conversion origins to find out more. + // Synthetic types should be short lived. + Unknown,the }; enum { InvalidLookupIndex = -1 }; QQmlJSRegisterContent() = default; + + // General properties of the register content, (mostly) independent of kind or variant + bool isNull() const { return !d; } bool isValid() const; - QString descriptiveName() const; - QString containedTypeName() const; - - bool isType() const; - bool isProperty() const; - bool isEnumeration() const; - bool isMethod() const; - bool isImportNamespace() const; - bool isConversion() const; - bool isMethodCall() const; bool isList() const; - bool isWritable() const; - bool isJavaScriptReturnValue() const; + ContentVariant variant() const; - QQmlJSRegisterContent attacher() const; - QQmlJSRegisterContent attachee() const; + QString descriptiveName() const; + QString containedTypeName() const; + + int resultLookupIndex() const; QQmlJSScope::ConstPtr storedType() const; QQmlJSScope::ConstPtr containedType() const; - QQmlJSRegisterContent scopeType() const; + QQmlJSScope::ConstPtr scopeType() const; + + bool contains(const QQmlJSScope::ConstPtr &type) const { return type == containedType(); } + bool isStoredIn(const QQmlJSScope::ConstPtr &type) const { return type == storedType(); } + + // Properties of specific kinds of register contents + + bool isType() const; QQmlJSScope::ConstPtr type() const; + + bool isProperty() const; QQmlJSMetaProperty property() const; int baseLookupIndex() const; - int resultLookupIndex() const; - + bool isEnumeration() const; QQmlJSMetaEnum enumeration() const; QString enumMember() const; + + bool isMethod() const; QList<QQmlJSMetaMethod> method() const; QQmlJSScope::ConstPtr methodType() const; + + bool isImportNamespace() const; uint importNamespace() const; QQmlJSScope::ConstPtr importNamespaceType() const; - QQmlJSScope::ConstPtr conversionResult() const; + + bool isConversion() const; + QQmlJSScope::ConstPtr conversionResultType() const; QQmlJSRegisterContent conversionResultScope() const; QList<QQmlJSRegisterContent> conversionOrigins() const; + + bool isMethodCall() const; QQmlJSMetaMethod methodCall() const; - ContentVariant variant() const; + bool isJavaScriptReturnValue() const; + + + // Linked register contents + QQmlJSRegisterContent attacher() const; + QQmlJSRegisterContent attachee() const; + + QQmlJSRegisterContent scope() const; QQmlJSRegisterContent storage() const; QQmlJSRegisterContent original() const; QQmlJSRegisterContent shadowed() const; - bool contains(const QQmlJSScope::ConstPtr &type) const { return type == containedType(); } - bool isStoredIn(const QQmlJSScope::ConstPtr &type) const { return type == storedType(); } - private: friend class QQmlJSRegisterContentPool; // TODO: Constant string/number/bool/enumval diff --git a/src/qmlcompiler/qqmljstypepropagator.cpp b/src/qmlcompiler/qqmljstypepropagator.cpp index 7520cb723a..b19bd64a62 100644 --- a/src/qmlcompiler/qqmljstypepropagator.cpp +++ b/src/qmlcompiler/qqmljstypepropagator.cpp @@ -748,7 +748,7 @@ bool QQmlJSTypePropagator::checkForEnumProblems( return true; } } else if (base.variant() == QQmlJSRegisterContent::MetaType) { - const QQmlJSMetaEnum metaEn = base.scopeType().containedType()->enumeration(propertyName); + const QQmlJSMetaEnum metaEn = base.scopeType()->enumeration(propertyName); if (metaEn.isValid() && !metaEn.isScoped() && !metaEn.isQml()) { const QString error = u"You cannot access unscoped enum \"%1\" from here."_s.arg(propertyName); @@ -891,7 +891,7 @@ void QQmlJSTypePropagator::propagatePropertyLookup(const QString &propertyName, if (m_state.accumulatorOut().variant() == QQmlJSRegisterContent::Singleton && m_state.accumulatorIn().variant() == QQmlJSRegisterContent::ModulePrefix - && !isQmlScopeObject(m_state.accumulatorIn().scopeType())) { + && !isQmlScopeObject(m_state.accumulatorIn().scope())) { m_logger->log( u"Cannot access singleton as a property of an object. Did you want to access an attached object?"_s, qmlAccessSingleton, getCurrentSourceLocation()); @@ -945,7 +945,7 @@ void QQmlJSTypePropagator::propagatePropertyLookup(const QString &propertyName, && m_state.accumulatorIn().variant() == QQmlJSRegisterContent::MetaType) { const QQmlJSScope::ConstPtr scopeType - = m_state.accumulatorIn().scopeType().containedType(); + = m_state.accumulatorIn().scopeType(); const auto metaEnums = scopeType->enumerations(); const bool enforcesScoped = scopeType->enforcesScopedEnums(); @@ -984,7 +984,7 @@ void QQmlJSTypePropagator::propagatePropertyLookup(const QString &propertyName, m_pool->create( prop, m_state.accumulatorIn().resultLookupIndex(), lookupIndex, // Use pre-determined scope type here to avoid adjusting it later. - QQmlJSRegisterContent::Property, m_state.accumulatorOut().scopeType()) + QQmlJSRegisterContent::Property, m_state.accumulatorOut().scope()) ); return; @@ -1358,12 +1358,12 @@ void QQmlJSTypePropagator::generate_CallProperty(int nameIndex, int base, int ar } if (baseType->accessSemantics() == QQmlJSScope::AccessSemantics::Sequence - && member.scopeType().contains(m_typeResolver->arrayPrototype()) + && member.scope().contains(m_typeResolver->arrayPrototype()) && propagateArrayMethod(propertyName, argc, argv, callBase)) { return; } - propagateCall(member.method(), argc, argv, member.scopeType()); + propagateCall(member.method(), argc, argv, member.scope()); } QQmlJSMetaMethod QQmlJSTypePropagator::bestMatchForCall(const QList<QQmlJSMetaMethod> &methods, @@ -1492,7 +1492,7 @@ void QQmlJSTypePropagator::mergeRegister( if (!lastTry.content.isConversion()) return false; - if (lastTry.content.conversionResult() != merged.conversionResult() + if (lastTry.content.conversionResultType() != merged.conversionResultType() || lastTry.content.conversionOrigins() != merged.conversionOrigins()) { return false; } @@ -1942,13 +1942,13 @@ void QQmlJSTypePropagator::propagateScopeLookupCall(const QString &functionName, = m_typeResolver->scopedType(m_function->qmlScope, functionName); if (resolvedContent.isMethod()) { const auto methods = resolvedContent.method(); - if (resolvedContent.scopeType().contains(m_typeResolver->jsGlobalObject())) { + if (resolvedContent.scope().contains(m_typeResolver->jsGlobalObject())) { if (propagateTranslationMethod(methods, argc, argv)) return; } if (!methods.isEmpty()) { - propagateCall(methods, argc, argv, resolvedContent.scopeType()); + propagateCall(methods, argc, argv, resolvedContent.scope()); return; } } @@ -2040,8 +2040,8 @@ void QQmlJSTypePropagator::generate_Construct(int func, int argc, int argv) { const QQmlJSRegisterContent type = m_state.registers[func].content; if (type.contains(m_typeResolver->metaObjectType())) { - const QQmlJSRegisterContent valueType = type.scopeType(); - const QQmlJSScope::ConstPtr contained = type.scopeType().containedType(); + const QQmlJSRegisterContent valueType = type.scope(); + const QQmlJSScope::ConstPtr contained = type.scopeType(); if (contained->isValueType() && contained->isCreatable()) { const auto extension = contained->extensionType(); if (extension.extensionSpecifier == QQmlJSScope::ExtensionType) { @@ -2609,10 +2609,10 @@ void QQmlJSTypePropagator::generate_As(int lhs) const QQmlJSRegisterContent accumulatorIn = m_state.accumulatorIn(); switch (accumulatorIn.variant()) { case QQmlJSRegisterContent::Attachment: - output = accumulatorIn.scopeType(); + output = accumulatorIn.scope(); break; case QQmlJSRegisterContent::MetaType: - output = accumulatorIn.scopeType(); + output = accumulatorIn.scope(); if (output.containedType()->isComposite()) // Otherwise we don't need it addReadAccumulator(m_typeResolver->metaObjectType()); break; diff --git a/src/qmlcompiler/qqmljstyperesolver.cpp b/src/qmlcompiler/qqmljstyperesolver.cpp index 17e8905517..4c441c8162 100644 --- a/src/qmlcompiler/qqmljstyperesolver.cpp +++ b/src/qmlcompiler/qqmljstyperesolver.cpp @@ -614,7 +614,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::merge( aResultScope = a.conversionResultScope(); } else { origins.insert(a); - aResultScope = a.scopeType(); + aResultScope = a.scope(); } QQmlJSRegisterContent bResultScope; @@ -625,7 +625,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::merge( bResultScope = b.conversionResultScope(); } else { origins.insert(b); - bResultScope = b.scopeType(); + bResultScope = b.scope(); } const auto mergeScopes = [&](const QQmlJSRegisterContent &a, const QQmlJSRegisterContent &b) { @@ -639,7 +639,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::merge( merge(a.containedType(), b.containedType()), mergeScopes(aResultScope, bResultScope), mergeVariants(a.variant(), b.variant()), - mergeScopes(a.scopeType(), b.scopeType())); + mergeScopes(a.scope(), b.scope())); } QQmlJSScope::ConstPtr QQmlJSTypeResolver::merge(const QQmlJSScope::ConstPtr &a, @@ -1586,7 +1586,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::memberType( // If we didn't find anything and it's an attached type, // we might have an enum of the attaching type. - return memberEnumType(type.scopeType(), name); + return memberEnumType(type.scope(), name); } if (type.isProperty() || type.isMethodCall()) return memberType(type, name, type.resultLookupIndex(), lookupIndex); @@ -1595,7 +1595,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::memberType( if (!type.enumMember().isEmpty() || !enumeration.hasKey(name)) return {}; return m_pool->create( - enumeration, name, QQmlJSRegisterContent::Enum, type.scopeType()); + enumeration, name, QQmlJSRegisterContent::Enum, type.scope()); } if (type.isMethod()) { QQmlJSMetaProperty prop; @@ -1608,12 +1608,12 @@ QQmlJSRegisterContent QQmlJSTypeResolver::memberType( QQmlJSRegisterContent::Property, type); } if (type.isImportNamespace()) { - if (type.scopeType().containedType()->accessSemantics() + if (type.scopeType()->accessSemantics() != QQmlJSScope::AccessSemantics::Reference) { m_logger->log(u"Cannot use a non-QObject type %1 to access prefixed import"_s.arg( - type.scopeType().containedType()->internalName()), + type.scopeType()->internalName()), qmlPrefixedImportType, - type.scopeType().containedType()->sourceLocation()); + type.scopeType()->sourceLocation()); return {}; } @@ -1626,7 +1626,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::memberType( return result; } - if (const auto result = memberEnumType(type.scopeType(), name); result.isValid()) + if (const auto result = memberEnumType(type.scope(), name); result.isValid()) return result; // If the conversion consists of only undefined and one actual type, @@ -1636,7 +1636,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::memberType( const auto nonVoid = extractNonVoidFromOptionalType(type); // If the conversion cannot hold the original type, it loses information. - return (!nonVoid.isNull() && canHold(type.conversionResult(), nonVoid.containedType())) + return (!nonVoid.isNull() && canHold(type.conversionResultType(), nonVoid.containedType())) ? memberType(nonVoid, name, type.resultLookupIndex(), lookupIndex) : QQmlJSRegisterContent(); } @@ -1656,7 +1656,7 @@ QQmlJSRegisterContent QQmlJSTypeResolver::valueType(const QQmlJSRegisterContent return m_sizeType; if (scope == m_forOfIteratorPtr) - return list.scopeType().containedType()->valueType(); + return list.scopeType()->valueType(); if (scope == m_jsValueType || scope == m_varType) return m_jsValueType; @@ -1775,19 +1775,19 @@ static QQmlJSRegisterContent doConvert( return pool->create( from.conversionOrigins(), to, scope.isValid() ? scope : from.conversionResultScope(), - from.variant(), from.scopeType()); + from.variant(), from.scope()); } return pool->create( QList<QQmlJSRegisterContent>{from}, to, scope, from.variant(), - from.scopeType()); + from.scope()); } QQmlJSRegisterContent QQmlJSTypeResolver::convert( const QQmlJSRegisterContent &from, const QQmlJSRegisterContent &to) const { - return doConvert(from, to.containedType(), to.scopeType(), m_pool.get()); + return doConvert(from, to.containedType(), to.scope(), m_pool.get()); } QQmlJSRegisterContent QQmlJSTypeResolver::convert( |
