[Libreoffice-bugs] [Bug 121101] New: Function parameter can duplicate dimension variable declaration
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Thu Nov 1 18:14:26 UTC 2018
https://bugs.documentfoundation.org/show_bug.cgi?id=121101
Bug ID: 121101
Summary: Function parameter can duplicate dimension variable
declaration
Product: LibreOffice
Version: 6.1.1.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: tony.sultana at pm.me
Description:
The following code has a parameter declared with the same name of a variable
declared with Dim in the function. The Dim statement resets the variable to
its default initialization (e.g. double, variant). If a second Dim statement
is added to declare v again then a compiling error is produced.
Sub test(v As Double)
Dim v As Double
v = 1
End Sub
I believe the correct behavior should be a compiling error that the variable is
already declared in the function parameter list so that it cannot be declared
with a Dim statement. This is the same error as if two Dim statements were
added to the function.
Steps to Reproduce:
1.Enter subroutine described
2.Enable watch on variable v
3.Monitor value in debug mode and note hat no error occurs
Actual Results:
The variable v is dimensioned replacing the function parameter definition
Expected Results:
A compiling error should have been produced as BASIC syntax error 'Variable is
already defined'
Reproducible: Always
User Profile Reset: No
Additional Info:
[Information automatically included from LibreOffice]
Locale: en-US
Module: BasicIDE
[Information guessed from browser]
OS: Linux (All)
OS is 64bit: yes
This has been tested on Win10 LO 6.1.2 and Linux Debian LO 6.1.3.
Version: 6.1.3.1
Build ID: 1:6.1.3~rc1-2
CPU threads: 8; OS: Linux 4.9; UI render: default; VCL: gtk3;
Locale: en-US (en_US.UTF-8); Calc: group threaded
Version: 6.1.1.2 (x64)
Build ID: 5d19a1bfa650b796764388cd8b33a5af1f5baa1b
CPU threads: 4; OS: Windows 10.0; UI render: default;
Locale: en-US (en_US); Calc: group threaded
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20181101/f07fd959/attachment-0001.html>
More information about the Libreoffice-bugs
mailing list