Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.15.8, 5.15, 6.2, 6.3.0 Alpha
-
5.15
-
Ubuntu 18.04 Linux x86 64 bit
-
-
be194d965d530e57ed5851781c6805e691c6ae98 (qt/qtdeclarative/dev) 28d426a9858b9f757b3eab89688ac38f029fc757 (qt/qtdeclarative/6.2) be32898873237dfd6864112e5242a30f3e680413 (qt/tqtc-qtdeclarative/5.15)
Description
Using an anonymous function as a default parameter in a function signature crashes the application:
// this will crash program
function crashFunction(functionptr=function(){}){ }
// complete example with work arounds import QtQuick 2.15 import QtQuick.Window 2.15 Window { width: 640 height: 480 visible: true title: qsTr("Crash QML Default Function Parameter") // this crashes function crashFunction(functionptr=function(){}){ functionptr(); } // work around 1 function emptyfunc(){} function nocrashFunction(functionptr=emptyfunc){ functionptr(); } // work around 2 function nocrashFunction(functionptr=null){ if(functionptr){ functionptr(); } } // work around 3 property var crashFunction: function(functionptr=function(){}){ functionptr(); } }
Attachments
Issue Links
- resulted in
-
QTBUG-98195 Default function arguments have the wrong scope
-
- Open
-