Details
-
Suggestion
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.1.2
-
None
Description
Given this `wat.qml` file:
import QtQuick
Item {
Column {
Loader { sourceComponent:foo }
Loader { sourceComponent:undefined }
Loader { sourceComponent:bar }
Loader { sourceComponent:bar ?? undefined}
}
Component {
id: foo
Item {}
}
}
I get this with Qt 6.1.2:
$ qml wat.qml wat.qml:6: ReferenceError: bar is not defined wat.qml:7: ReferenceError: bar is not defined
As line 5 is not an error, is the error for line 7 a bug? (And should not be an error?)
If undefined is a problem, could we use null or something else to ignore the error when bar is (by choice) not defined? (FWIW, my app works as intended, even with this error, so i would just want to not see the error;P)
PS. My use-case is that BaseItem has some default UI (AKA QML Items and "layouts") and somewhere in-between is a Loader for bar, and the "extender" (do we call them that?) of BaseItem can choose to implement bar or not. (If there's an easier way to implement such feature, let me know)