Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-137540

[Reg 6.5.0 -> 6.5.5] Compilation blog post example doesn't work anymore

    XMLWordPrintable

Details

    • 2afe05b64 (tqtc/lts-6.5), a85d36b8a (6.10), bb98127e3 (6.10), 2993762d3 (6.9), cf15698d4 (6.9), ca8b14feb (6.9), c36360eb1 (6.9), 9bfcc36f2 (tqtc/lts-6.8), 9bc25cd53 (tqtc/lts-6.8), dfc56c205 (tqtc/lts-6.8), 564d2eb26 (tqtc/lts-6.8), b9974d82c (dev)

    Description

      The example from https://www.qt.io/blog/compiling-qml-to-c-a-4x-speedup doesn't compile to C++ anymore. You instead get:

      Categorizer.qml:24: warning: Could not compile binding for numbers: Cannot generate efficient code for storing an array in a non-sequence type [compiler]
      Categorizer.qml:39: warning: Could not compile function sum: Cannot generate efficient code for LoadElement on a sequence potentially affected by side effects [compiler]
      Categorizer.qml:59: warning: Could not compile binding for onCompleted: Cannot generate efficient code for LoadElement on a sequence potentially affected by side effects [compiler]
      

      There's no obvious reason for this. The array shouldn't have to be stored in anything but list<double> and the numbers in sum() are not actually affected by any side effects.

      In onCompleted it probably assumes console.log() has side effects. We could deal with that by starting to mark specific functions as pure. However, onCompleted is not the hot code path here.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              ulherman Ulf Hermann
              ulherman Ulf Hermann
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change