I normally don't don't use debug mode but rely on #Bridgelogger: True logging to track program flow. This time I thought it might track me through a complicated set of conditionals so I enabled debug mode, and the working code promptly failed to compile
B4A Version: 10.0
Java Version: 8
Parsing code. (0.04s)
Building folders structure. (0.02s)
Compiling code. Error
Error compiling program.
Error description: Current declaration does not match previous one.
Error occurred on line: 353
For Each name As String In childlist
Word: _ref
The error is in this Sub
Sub GetChildren(dv As DraggableView, children As List)
Dim v As View = dv.lblView
Dim vi As ViewInfo = v.Tag
Dim childlist As List = vi.ViewChildren
children.AddAll(childlist)
For Each name As String In childlist ' <--------------- here
Dim childdv As DraggableView = ViewsNamesMap.Get(name.ToLowerCase)
GetChildren(childdv, children)
Next
End Sub
If I change variable
name to
aname the compilation failure moves to a similar construct in a different Sub
For Each name As String In allchildren ' <--------------- here
If name.ToLowerCase = parentname Then
IsChild = True
End If
Next
If I change variable
name to
bname the compilation now succeeds. It turns out that I unwittingly have a
in that modules' Sub Class_Globals
but the editor Intellisense does not pick up the type redeclaration of the name when used as a loop variable whereas it does elsewhere!