Closed anguwardavi closed 7 months ago
I have this Test.qml file: `import QtQuick import QtQuick.Layouts import QtQuick.Controls Rectangle {
function returnPair() { return [1,2]; } function acceptPairDestructured() { const [a,b] = returnPair(); }
} When I run the v6.5.0 version of qmlformat on the file with the-V -i` options, I get the following. Note the extra '[' inserted after the "[a, b]"
When I run the v6.5.0 version of qmlformat on the file with the
import QtQuick import QtQuick.Layouts import QtQuick.Controls
Rectangle {
function returnPair() { return [1, 2]; } function acceptPairDestructured() { const [a, b][ = returnPair(); }
}
C:/tmp/Test.qml:12:21: [Dom][QmlFile][Parsing] Error: Unexpected token `[' for .currentItem
qt.qmldom.writeOut: failure reformatting "Test.qml" "Error while writing" `
Sorry. This should have been logged against Qt and the qmlformat app.
I have this Test.qml file: `import QtQuick import QtQuick.Layouts import QtQuick.Controls Rectangle {
}
When I run the v6.5.0 version of qmlformat on the file with the
-V -i` options, I get the following. Note the extra '[' inserted 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 {
}
C:/tmp/Test.qml:12:21: [Dom][QmlFile][Parsing] Error: Unexpected token `[' for .currentItem
qt.qmldom.writeOut: failure reformatting "Test.qml" "Error while writing" `