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

qmlsc: Cannot resolve type annotations for args of type list<T>

    XMLWordPrintable

Details

    • 91c6d45559 (qt/qtdeclarative/dev) 91c6d45559 (qt/tqtc-qtdeclarative/dev)

    Description

      Qt 6.4.0 added support for property list<T> (see https://doc.qt.io/qt-6/qml-list.html#using-the-list-type ) but the corresponding type annotations are not supported.

       

      Code

      import QtQuick
      
      Window {
          width: 640
          height: 480
          visible: true
      
          property list<int> intList: [1, 2, 3, 4]
      
          function printList(arr: list<int>) {
              console.log(`Array of ${arr.length} items: [${arr}]`)
          }
      
          Component.onCompleted: printList(intList)
      }
      

       

      Compile Output

      Error: main.qml:10:5: Could not compile function printList: Cannot resolve the argument type list.
          function printList(arr: list<int>) {
          ^^^^^^^^^
      Error: main.qml:14:28: Could not compile binding for onCompleted: type list for argument 0 cannot be resolved
          Component.onCompleted: printList(intList)
                                 ^^^^^^^^^
      

      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
              skoh-qt Sze Howe Koh
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes