diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-04 16:54:56 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-11-08 20:49:17 +0100 |
commit | a0290dcc53a14b67c0179c43ce8dc21b43cfc83b (patch) | |
tree | 6144a1569f3943b71d42c365bb6e4866b8f00474 /dependencies.yaml | |
parent | 50cd61a234e058ea8d9331795944b2d94ec525c6 (diff) | |
download | qtdeclarative-a0290dcc53a14b67c0179c43ce8dc21b43cfc83b.tar.gz |
QML: Fix precedence between imports
So far we have "normal", "low precedence", and "implicit" imports.
Normal imports were ordered in document order, later imports overriding
earlier ones. Low precedence imports were ordered in intractable
confusion, and implicit imports were added last, with the actual
implicit import first, and any dependencies of it after it in
intractable confusion.
Since that gives us problems when QtQml is split into an empty "meta"
module and a number of dependencies, we have to clear out the confusion.
Following the principle that direct imports have higher precedence than
indirect ones, we can give each import a precedence number, depending on
whether it is implicitly imported or not, and how much the importer has
recursed to reach it. Ordering the imports by that number results in a
less confused structure, more accessible to reason.
Also, module imports were added in different order depending on whether
they were revisioned or not. Add them always in the same order.
[ChangeLog][QtQml][Important Behavior Changes] The precedence of imports
that expose different types for the same name has changed. Previously
the algorithm was rather confused. Now, the rule of thumb is that
more direct imports override more indirect ones. That means QtObject
imported directly from QtQml is of higher precedence than QtObject
imported from QtQml via QtQuick. Where that still leaves ambiguities,
imports later in the document override imports earlier in the document.
Any explicit imports and their dependencies always override the implicit
import and its dependencies.
Task-number: QTBUG-105240
Change-Id: I5f95f6bb8367087b9d977cb01f434d01bb402a3e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'dependencies.yaml')
0 files changed, 0 insertions, 0 deletions