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

REG: Compiled QML yields wrong result for undefined == null

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5.0, 6.5, 6.6.0
    • 6.5.0 Beta2
    • QML: Compiler
    • None
    • 66bc00196 (dev), 4e61da2a0 (6.5)

    Description

      Take the following code:

      import QtQuick
      import QtQuick.Window
      
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
      
          property var test: null
          property bool isOk: test == undefined
          property bool isOk2: null == undefined
      
          Component.onCompleted: {
              console.debug("isOK: " + isOk + ", isOk2: " + isOk2)
          }
      }
      

      When run directly, this outputs:

      qml: isOK: true, isOk2: true
      

      However, if you add CONFIG += qtquickcompiler to the application .pro file, then it outputs:

      qml: isOK: false, isOk2: true
      

      This appears to be a regression since Qt 6.4, and is the cause of QTBUG-110745.

      Attachments

        Issue Links

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

          Activity

            People

              semih.yavuz Semih Yavuz
              esabraha Eskil Abrahamsen Blomfeldt
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes