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

qmlsc: Cannot access members of a list

    XMLWordPrintable

Details

    Description

      Operator [] for typed QML list cannot be compiled if the returned object is used in some way. Attached example shows two cases where it fails in different ways.

       

                      var item = buttons[i]
                      if (item !== undefined) {
                          myButton = item

       

      fails with potentially undefined, and:

                      var item = buttons[i]
                      if (item !== undefined) {
                          setButton(item, "button " + i)

       

      fails with LoadElement for the buttons[i] line.

      Attachments

        1. qtbug12210.zip
          2 kB
          Joni Poikelin

        Activity

          People

            qtqmlteam Qt Qml Team User
            poikelin Joni Poikelin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: