Commit Graph

2 Commits

Author SHA1 Message Date
Ulf Hermann e2611e8ee9 QmlCompiler: Fix conditions around as casts
We can only generate an as-cast from an optional value type if we know
that the optional type is actually the requested one. Otherwise we have
to reject for now. We might add more logic here in a further iteration,
and process more complicated type assertions. However, we should pick
such logic back to 6.6.

Amends commit 05f56d7c78.

Pick-to: 6.7 6.6
Change-Id: I37fc1b6018bfb0663e5ce4fd80084c7d13c6d3e3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2024-02-21 14:27:54 +01:00
Olivier De Cannière fc4ee77116 Compiler: Add initial support for optional chaining
This patch implements the GetOptionalLookup instruction in the compiler.
This enables the use of optional chains.

Fixes: QTBUG-111283
Change-Id: I265f611415a946468b828b9d41f549acfcc76233
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-11-24 18:34:03 +01:00