diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2014-01-22 16:40:46 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-24 12:39:28 +0100 |
commit | 6ae57f01bb1495a74b23a81c590672ce788d5400 (patch) | |
tree | 2a40e225495a132762d22de0c066b02ecd20630f /src/qml/compiler/qqmlcodegenerator.cpp | |
parent | 72fffeb2c1086a8b5f5ce5b5410cd0c1da2404ac (diff) | |
download | qtdeclarative-6ae57f01bb1495a74b23a81c590672ce788d5400.tar.gz |
[new compiler] Fix error message when trying to create uncreatable types
Pass along the no-creation-reason properly, for regular qml types as well as
singleton types. Also don't collect custom signal parameter names as types to
resolve, as we never try to instantiate them anyway. Their type resolution to
meta-type id is done lazily when building the meta-objects.
Change-Id: I49bd51d9b851cf75cbd51afbcee168944f4350cd
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/compiler/qqmlcodegenerator.cpp')
-rw-r--r-- | src/qml/compiler/qqmlcodegenerator.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qml/compiler/qqmlcodegenerator.cpp b/src/qml/compiler/qqmlcodegenerator.cpp index a5bb5670be..2ba13be090 100644 --- a/src/qml/compiler/qqmlcodegenerator.cpp +++ b/src/qml/compiler/qqmlcodegenerator.cpp @@ -1020,15 +1020,13 @@ void QQmlCodeGenerator::collectTypeReferences() _typeReferences.add(obj->inheritedTypeNameIndex, obj->location); for (QmlProperty *prop = obj->properties->first; prop; prop = prop->next) { - if (prop->type >= QV4::CompiledData::Property::Custom) - _typeReferences.add(prop->customTypeNameIndex, prop->location); + 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); + } } - for (Signal *sig = obj->qmlSignals->first; sig; sig = sig->next) - for (SignalParameter *param = sig->parameters->first; param; param = param->next) - if (!stringAt(param->customTypeNameIndex).isEmpty()) - _typeReferences.add(param->customTypeNameIndex, param->location); - for (Binding *binding = obj->bindings->first; binding; binding = binding->next) { if (binding->type == QV4::CompiledData::Binding::Type_AttachedProperty) _typeReferences.add(binding->propertyNameIndex, binding->location); |