This was reported years ago for OOo/AOO under a different accent. See https://bz.apache.org/ooo/show_bug.cgi?id=120069 It may just be another bug demonstrating that a consistent implementation of automatic type conversion is next to impossible. Examples: Sub TestVariant() x = 77 REM Creates x as a Variant of current type Integer in_outI(x) REM Implicitly "converts" Variant/Integer to Integer creating a new variable. Print x REM should print 13, prints 77 in_outV(x) REM No implicit conversion Print x REM should print 13, prints 13 End Sub Sub TestByte() Dim x As Byte x = 77 in_outI(x) REM Implicitly converts Byte to Integer creating a new variable. REM Should throw a type mismatch. REM Otherwise automatic conversion of the result on return needed. REM VERY problematic. Print x REM should print 13, prints 77 in_outV(x) REM Implicitly converts Byte to Integer creating a new variable. Print x REM should print 13, prints 13 End Sub Sub TestInteger() Dim x As Integer x = 77 in_outI(x) REM No implicit conversion. Print x REM should print 13, prints 13 End Sub Sub in_outI(x As Integer) x = 13 End Sub Sub in_outV(x) x=13 End Sub Sub TestVS() x = "test" in_outS(x) REM Implicitly "converts" Variant/String to String creating a new variable. Print x in_outSV(x) REM No conversion. Print x End Sub Sub in_outS(x As String) x = "in_out" End Sub Sub in_outSV(x As Variant) x = "in_out" End Sub What should be expected and what actually happens is placed in the example as comments.
https://opengrok.libreoffice.org/xref/core/basic/source/runtime/runtime.cxx?r=8c0059e1#4054 t : parameter type p->GetType() : argument type
cf. https://opengrok.libreoffice.org/xref/core/basic/source/sbx/sbxvalue.cxx?r=b0de7a89#266 (I'm not that sure)
Reproduced in Version: 6.5.0.0.alpha0+ Build ID: 775a06361639ffc539fda20d44b9610c98005d9b CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US Calc: threaded
Dear Wolfgang Jäger, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
(In reply to QA Administrators from comment #4) > Dear Wolfgang Jäger, ... > > If you have time, please do the following: > > MassPing-UntouchedBug Tested with V 7.3.0.0.beta1 (x64) under Win10. Results unchanged. (The regression check already was done in advance of reporting the bug.) === An additional aspect: The Basic code posted in the report relied on the default ByRef way of passing parameters to Basic subroutines. I now also tested with the explicit ByRef clause. The results were unchanged. The mentioned additional test also ran in jurassic LibO V 3.3.0.4 (32 bit PortableApps) with unchanged results. I didn't test anew with versions in-between. === ====== Suggestion: The behaviour as originally reported, and judged to be a bug based on the specification of ByRef as default parameter passing in Basic, may be left unchanged. In very rare cases a change might even break old code. In case of *explictly declared ByRef* the handling should either actuallly grant ByRef, or -where the implementation can't do so for fundamental reasons- throw an error. ======