QmlCompiler: Don't needlessly generalize input on SetPropertyLookup

If we get a verbatim type as input there, we can just use it.

Change-Id: If04c29c3756664718bf482a016f431cc5f26cee5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Ulf Hermann 2023-03-14 14:53:26 +01:00
parent 53998de985
commit 3957c55f86
1 changed files with 6 additions and 2 deletions

View File

@ -1157,8 +1157,12 @@ void QQmlJSCodeGenerator::generate_SetLookup(int index, int baseReg)
+ m_jsUnitGenerator->lookupName(index));
return;
}
const QQmlJSRegisterContent property = specific.storedIn(
m_typeResolver->genericType(specific.storedType()));
// Choose a container that can hold both, the "in" accumulator and what we actually want.
// If the types are all the same because we can all store them as verbatim C++ types,
// the container will also be that type.
const QQmlJSScope::ConstPtr container = m_typeResolver->merge(specific.storedType(), valueType);
const QQmlJSRegisterContent property = specific.storedIn(container);
const QString object = registerVariable(baseReg);
m_body += u"{\n"_s;