Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.5.0
-
None
-
-
d7d1059ef96ff0410f5e3644f64059f16ea3b2b9, 115916f217b0dc299b8df298f5c9c30369f561f8
Description
given this qml file:
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Rectangle {
function returnPair()
function acceptPairDestructured()
{ const [a,b] = returnPair(); }}
when using the windows v6.5.0 version of qmlformat.exe with the -i and -V options, I get the following (Note the extra '[' character after the "[a,b]"
Dumping Test.qml
Writing to file Test.qml
qt.qmldom.writeOut: writeOut of C:/tmp/Test.qml created invalid code:
----------
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
Rectangle {
function returnPair()
function acceptPairDestructured()
{ const [a, b][ = returnPair(); }}
----------
C:/tmp/Test.qml:11:21: [Dom][QmlFile][Parsing] Error: Unexpected token `[' for .currentItem
qt.qmldom.writeOut: failure reformatting "Test.qml"
"Error while writing"