Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.15
Description
qmlformat removes initialisation in if statements if not covered by a variable definitions:
import QtQuick 2.15 Item { function test() { let i = 0; for(i = 1; i < 10; i++) { } } }
is formatted to
import QtQuick 2.15 Item { function test() { let i = 0; for (; i < 10; i++) { } } }
Note the missing `i = 1` in the for loop. If I remove the `let` state and write `let i = 1` in the for loop, everything is okay.