- 
     Technical task Technical task
- 
    Resolution: Unresolved
- 
    P3: Somewhat important 
Yes, it's technically an untyped JavaScript function... but could we check the type of the property instead?
Code
import QtQuick import QtQuick.Controls.Basic Window { id: root width: 300 height: 200 visible: true property color myColor: "green" Column { Rectangle { id: rectangle width: 100 height: 100 color: "red" border.color: "black" border.width: 5 } Button { text: "Update color binding" onClicked: rectangle.color = Qt.binding(function() {return root.myColor}) } } }
Compiler output
Warning: main.qml:23:33: Could not compile binding for onClicked: Cannot generate efficient code for LoadClosure [compiler]
            onClicked: rectangle.color = Qt.binding(function() {return root.myColor})
                                         ^^
- relates to
- 
                    QTBUG-101531 qmlsc issue with change signal handler -         
- Closed
 
-         
- 
                     QTBUG-112603
        StackView.find() cannot be compiled by qmlsc QTBUG-112603
        StackView.find() cannot be compiled by qmlsc-         
- Reported
 
-         
- 
                     QTBUG-101464
        Support Qt.callLater QTBUG-101464
        Support Qt.callLater-         
- Open
 
-