diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-27 16:55:49 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-29 10:08:50 +0100 |
commit | 3d3429f55bca1b09c1d2184ef719abae0e762a09 (patch) | |
tree | fbf79751ef8c18bfa594667c9c0d3c62d986e06b /src/qml/compiler/qqmlcodegenerator.cpp | |
parent | 7cfd7ab2b1244681e384ec4640ee6e528881f4af (diff) |
[new compiler] Avoid uncreatable type errors for types that aren't created
QtQuick.Keys for example is not creatable, but it's also never created but
only used as attached properties. Therefore types used as attached properties
create the needCreation = false flag in the referenced types.
Change-Id: I6ca3a3ff677858bf3c55d3e08a0f0fc8ee9160fe
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlcodegenerator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlcodegenerator.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index 344c38bf54..6776c1e91b 100644 --- a/src/qml/compiler/qqmlcodegenerator.cpp +++ b/src/qml/compiler/qqmlcodegenerator.cpp @@ -1056,14 +1056,17 @@ void QQmlCodeGenerator::recordError(const AST::SourceLocation &location, const Q void QQmlCodeGenerator::collectTypeReferences() { foreach (QmlObject *obj, _objects) { - if (!stringAt(obj->inheritedTypeNameIndex).isEmpty()) - _typeReferences.add(obj->inheritedTypeNameIndex, obj->location); + if (!stringAt(obj->inheritedTypeNameIndex).isEmpty()) { + QV4::CompiledData::TypeReference &r = _typeReferences.add(obj->inheritedTypeNameIndex, obj->location); + r.needsCreation = true; + } for (QmlProperty *prop = obj->properties->first; prop; prop = prop->next) { if (prop->type >= QV4::CompiledData::Property::Custom) { // ### FIXME: We could report the more accurate location here by using prop->location, but the old // compiler can't and the tests expect it to be the object location right now. - _typeReferences.add(prop->customTypeNameIndex, obj->location); + QV4::CompiledData::TypeReference &r = _typeReferences.add(prop->customTypeNameIndex, obj->location); + r.needsCreation = true; } } |