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

Function call with destructured argument silently aborts compilation

    XMLWordPrintable

Details

    • 8f827de1a1 (qt/qtdeclarative/dev) 8f827de1a1 (qt/tqtc-qtdeclarative/dev) 7e81ff6835 (qt/tqtc-qmlcompilerplus/6.2) 7e81ff6835 (qt/tqtc-qmlcompilerplus/6.2.7), 17b72353f (6.4)

    Description

      Calling methods with destructured arguments via

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          Component.onCompleted: {
              let f = console.error;
              const data = [f, ["That is great!"]]
              data[0](...data[1]);            // Fails
              //data[0].apply(null, data[1]); // Works
          }
      }
      

      leads just to

      [1/10 385.8/sec] Generating variadic/main.qml
      [2/10 746.0/sec] Generating variadic/DetachableConnections.qml
      [3/10 347.4/sec] Running qmlimportscanner for appvariadic
      [4/10 310.8/sec] Running rcc for resource appvariadic_raw_qml_0
      [5/10 111.6/sec] Generating .rcc/qmlcache/appvariadic_DetachableConnections_qml.cpp
      [6/10 35.6/sec] Generating .rcc/qmlcache/appvariadic_main_qml.cpp
      FAILED: .rcc/qmlcache/appvariadic_main_qml.cpp /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug/.rcc/qmlcache/appvariadic_main_qml.cpp 
      cd /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug && /home/prcs1076/Qt/Tools/CMake/bin/cmake -E make_directory /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug/.rcc/qmlcache && /home/prcs1076/Qt/6.5.0/gcc_64/./libexec/qmlsc --bare --resource-path /variadic/main.qml -I /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug -I /home/prcs1076/Qt/6.5.0/gcc_64/./qml -i /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug/variadic/qmldir --resource /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug/.rcc/qmake_variadic.qrc --resource /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug/.rcc/appvariadic_raw_qml_0.qrc -o /home/prcs1076/tmp/build-variadic-Desktop_Qt_6_5_0_GCC_64bit-Debug/.rcc/qmlcache/appvariadic_main_qml.cpp /home/prcs1076/tmp/variadic/main.qml
      ninja: build stopped: subcommand failed.

      , leaving you in the dark what the problem is. Takes a while to find that if you've hundreds of QML files and there's not even a hint about the file which is responsible for that.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            cajus Cajus Pollmeier
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes