Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.4.1
-
bce216d5c0 (qt/qtdeclarative/dev) bce216d5c0 (qt/tqtc-qtdeclarative/dev) 39aba03d4c (qt/qtdeclarative/6.4) 39aba03d4c (qt/tqtc-qtdeclarative/6.4)
Description
property var v: null Component.onCompleted: { var g = null if (g !== null) {} }
will fail with a compile error:
/foo/minipdf_main_qml.cpp:223:9: error: expected primary-expression before ‘!=’ token 223 | r2_1 = != ; | ^~ /foo/minipdf_main_qml.cpp:223:12: error: expected primary-expression before ‘;’ token 223 | r2_1 = != ; | ^
generated code in the .cpp file looks like this:
extern const QQmlPrivate::AOTCompiledFunction aotBuiltFunctions[] = { { 0, QMetaType::fromType<void>(), { }, [](const QQmlPrivate::AOTCompiledContext *aotContext, void *dataPtr, void **argumentsPtr) { wrapCall(aotContext, dataPtr, argumentsPtr, [](const QQmlPrivate::AOTCompiledContext *aotContext, void **argumentsPtr) { Q_UNUSED(aotContext); Q_UNUSED(argumentsPtr); bool r2_1; // Component.onCompleted: { // generate_CreateCallContext { // var g = null // if (g !== null) {} // generate_CmpStrictNotEqual r2_1 = != ; // generate_JumpFalse if (!r2_1) ; // generate_PopContext ;} // generate_Ret return; });} },{ 0, QMetaType::fromType<void>(), {}, nullptr }}; QT_WARNING_POP } }
Attachments
For Gerrit Dashboard: QTBUG-108634 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
444125,5 | QmlCompiler: Fix comparison of null and undefined | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
444895,3 | QmlCompiler: Fix comparison of null and undefined | 6.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |