1 ' This file is part of the LibreOffice project.
3 ' This Source Code Form is subject to the terms of the Mozilla Public
4 ' License, v. 2.0. If a copy of the MPL was not distributed with this
5 ' file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 Function assignVarToMethod() As Integer
12 ' method name used as dimension specifier
13 Dim fieldOfLongs() As Long
14 ReDim fieldOfLongs(assignVarToMethod
) As Long
16 ' method name used as loop index
18 For assignVarToMethod
= 1 To 3
19 sum
= sum
+ assignVarToMethod
20 Next assignVarToMethod
21 assignVarToMethod
= sum
25 Function doUnitTest() As String
29 ' tdf#85371 - check if the name of the method can be used as a variable in certain statements
30 If (assignVarToMethod() <> 6) Then Exit Function
31 ' tdf#85371 - check if an assignment to the function fails outside of the function itself
33 If (assignVarToMethod() <> 6) Then Exit Function