diff --git a/src/qmlcompiler/qqmljscodegenerator.cpp b/src/qmlcompiler/qqmljscodegenerator.cpp index 687bdbdb8f..e6723a25b6 100644 --- a/src/qmlcompiler/qqmljscodegenerator.cpp +++ b/src/qmlcompiler/qqmljscodegenerator.cpp @@ -448,6 +448,7 @@ void QQmlJSCodeGenerator::generate_MoveConst(int constIndex, int destTemp) input = toNumericString(v4Value.doubleValue()); } else { reject(u"unknown const type"_s); + return; } m_body += conversion(contained, changed, input) + u";\n"_s; generateOutputVariantConversion(contained); diff --git a/tests/auto/qml/qmlcppcodegen/data/failures.qml b/tests/auto/qml/qmlcppcodegen/data/failures.qml index 35dd1f0255..22c0c8390a 100644 --- a/tests/auto/qml/qmlcppcodegen/data/failures.qml +++ b/tests/auto/qml/qmlcppcodegen/data/failures.qml @@ -81,4 +81,6 @@ QtObject { readonly property int someNumber: 10 function writeToReadonly() { someNumber = 20 } + + property var silly: [,0] }