Apache OpenOffice (AOO) Bugzilla – Issue 18740
Public variables in two modules of the same library fight
Last modified: 2017-05-20 11:28:10 UTC
In one library, create two modules. In one module, declare a public variable as an Integer. In the other module, declare a public variable as a Double. No error occurs and you do not know which variable you will see in both modules until runtime.
not API but StarBASIC
This is no error. Each module sees it's own variable. VB also does not rise an error in this situation.
Actually, each module does not see it's own variables. In module one, add Public ii As Integer Sub aaa ii = 3.4 bbb() Print "In module one ii = " & ii End Sub In module two, add Public ii As Double Sub bbb ii = 6.4 Print "In module two ii = " & ii End Sub When I ran this, it printed 6.4 in aaa which is not only the wrong value, it is the wrong type! The Private type is not a problem... If you mark the case as resolved, again, I will not re-open it, but you indicated that each module sees only it's own variable. Unfortunately, this is not the behavior that I see. If this has already been modified, then slap me around a little bit, I probably deserve it :-)You do an awesome job Andreas! Ultimately, I am fine with it either way. My only complaint is that the same variable name had different types allowing me to know which was which... I have not found a way to determine which version is seen. I have not bothered to find a deterministic algorithm for which variable is recognized... Andrew Pitonyak
You're right, my test case was too simple. So relax, I will not slap you around! And thank you for the flowers... ;-)
cp: retargeted to Office-Later due to limited ressources
Another aspect of this problem is that also different Functions with the same name are not identified correctly even if they have a different signature with different parameters. In StarOffice we have a function "GetDocumentType(oDocument)" in the Tools library and one "GetDocumentType()" in the Launcher library
Reset assigne to the default "issues@openoffice.apache.org".