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

V4 error: "conditional function or closure declaration"

    XMLWordPrintable

Details

    • 1708b36910984b116b12432e7d27f8fbb25fadfa

    Description

      The following test case works with Qt 5.1.0 (the rectangle shows up green), but not with the latest qt5-dev.

      import QtQuick 2.1
      
      Rectangle {
          width: 360
          height: 360
      
          color: testFunc()
      
          function testFunc() {
              if (true) {
                  // 'conditional function or closure declaration'
                  function nestedFunc() { return "mediumseagreen" }
                  return nestedFunc()
              }
          }
      }
      

      Real-world use case - hslToRgb(): http://axonflux.com/handy-rgb-to-hsl-and-rgb-to-hsv-color-model-c

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes