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

Using a specific as-cast asserts and fails compilation

    XMLWordPrintable

Details

    • 096f3c309 (dev), 23af49f74 (6.6), 69257e46a (tqtc/lts-6.5)

    Description

      property var tmp4: (null as GOL_Object)

      Causes an assert: 

      FAILED: .rcc/qmlcache/truc_Main_qml.cpp /home/icristalrope/asCastBug-build/.rcc/qmlcache/truc_Main_qml.cpp
      cd /home/icristalrope/asCastBug-build && /usr/bin/cmake -E make_directory /home/icristalrope/asCastBug-build/.rcc/qmlcache && /home/icristalrope/qt6-build/qtbase/libexec/qmlcachegen --bare --resource-path /qt/qml/Truc/Main.qml -I /home/icristalrope/asCastBug-build -I /home/icristalrope/qt6-build/qtbase/./qml -i /home/icristalrope/asCastBug-build/Truc/qmldir --resource /home/icristalrope/asCastBug-build/.rcc/qmake_Truc.qrc --resource /home/icristalrope/asCastBug-build/.rcc/truc_raw_qml_0.qrc -o /home/icristalrope/asCastBug-build/.rcc/qmlcache/truc_Main_qml.cpp /home/icristalrope/asCastBug/Main.qml
      ASSERT: "it != registers.end()" in file /home/icristalrope/qt6-build/qtbase/include/QtQmlCompiler/6.7.0/QtQmlCompiler/private/../../../../../../../qt6/qtdeclarative/src/qmlcompiler/qqmljscompilepass_p.h, line 97
      Aborted
      ninja: build stopped: subcommand failed. 

      However, the following does not:

          property var tmp1: console.log((null as GOL_Object).i)
          property var tmp2: console.log((null as GOL_Object))
          property var tmp3: (undefined as GOL_Object)

      Attachments

        1. asCastBug.zip
          2 kB
          Olivier De Cannière
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ulherman Ulf Hermann
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews