Consider this BASIC code: ' No Option VBASupport Sub Foo(Optional x As Double, Optional y As Double) MsgBox ismissing(x) & " " & ismissing(y) End Sub Sub Bar Foo(y:=10) End Sub It produces "False False", instead of expected "True False"; and inspecting value of x inside Foo gives 0. In non-VBASupport mode, we should not initialize missing optional arguments; the problem looks specific to the := argument value syntax, and e.g. Foo(, 10) produces expected "True False". Tested with Version: 7.2.0.2 (x64) / LibreOffice Community Build ID: 614be4f5c67816389257027dc5e56c801a547089 CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win Locale: ru-RU (ru_RU); UI: en-US Calc: threaded
Reproduced. Version: 7.1.4.2 / LibreOffice Community Build ID: 10(Build:2) CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Ubuntu package version: 1:7.1.4~rc2-0ubuntu0.20.04.1~lo1 Calc: threaded
Already in Version 4.0.0.1 (Build ID: 527dba6f6e0cfbbc71bd6e7b88a52699bb48799) Not so easy to solve on my side. Sub Foo(Optional x As Double, Optional y As Double) MsgBox ismissing(x) & " " & ismissing(y) End Sub The parser initializes the variable x as double and sets it as optional. Sub Bar Foo(y:=10) End Sub Here it initializes the variable y to integer with a the value 10. However, it does not generate a StepEMPTY for StepPARAM since there is no COMMA token for the function Foo. Maybe there could be some logic scanning the parameter list for function Foo and the actual call of the function in [1]. Then, there could be an additional StepEMPTY for the parameter x in this case. Maybe there is another approach, but currently, I could not find any satisfying solution for me. [1] https://opengrok.libreoffice.org/xref/core/basic/source/comp/exprtree.cxx?r=a5c1a645#955