Solved qmlformat 6.3.0 let to var "Error while writing"
-
Running the qmlformat binary from Qt 6.3.0 on a Mac or (Ubuntu 20) there is a consistent "Error while writing" when attempting to reformat inplace. It occurs when there is a for loop where the index is declared with let and it should be reformatted to var.
Command: qmlformat MyFile.qml -i
Original:for (let i = 0; i < model.count; i++) { // do something }
Reformatted:
for (var i = 0; i < model.count; i++) { // do something }
Error message: "Error while writing"
Is this known? Will it be fixed?
Edit: Reproduced under linux
-
Looks like a fix will be in an upcoming release of 6.x.x
https://codereview.qt-project.org/c/qt/qtdeclarative/+/425203@moderator Please mark as resolved.
-
Now an official bug:
https://bugreports.qt.io/browse/QTBUG-105361 -
Looks like a fix will be in an upcoming release of 6.x.x
https://codereview.qt-project.org/c/qt/qtdeclarative/+/425203@moderator Please mark as resolved.
-
@qmluser Hi, you can mark it solved yourself using the "Topic Tools" button or the three dotted menu beside the answer you deem correct :-)