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

[Reg 6.6 -> 6.7] qmlsc: type mismatch generates uncompilable code

    XMLWordPrintable

Details

    • 6f74f50fe (dev), 1aec0bc15 (6.7)

    Description

      A type mismatch in two C++ defined components that are wired by QML (here moo/int vs foo/unsigned short)

          property Moo moo
      
          QtObject {
              readonly property Foo foo: Foo {
                  uid: root.moo?.uid ?? 0xFFFF  // Fails
                  //uid: root.moo.uid  // Works
              }
          }
      

      leads to:

      /appfoo_Main_qml.cpp:315:8: error: inconsistent types ‘short unsigned int’ and ‘unsigned int’ deduced for lambda return type
        315 | return uint(r2_3.toInteger());
            |        ^~~~~~~~~~~~~~~~~~~~~~
      

      While this is clearly a problem of inconsistent interfaces on the C++ side, I'd expect some kind of warning/error before becoming qml.cpp file.

      On the other side, it's inconsistent between the two commented works/fails lines. And it's a regression for 6.6, as both variants work there.

      Attachments

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

        Activity

          People

            olivier.decanniere Olivier De Cannière
            cajus Cajus Pollmeier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes