Project: | Prolint Issue Tracker |
Component: | Code |
Category: | bug report |
Priority: | critical |
Assigned: | jurjen |
Status: | closed |
Prolint doesn't find the definition of a function inside a do...end block. Therefore i get false positives on rule Tablename... this is unexpected. Since we use the results of Prolint to determine whether an object can be checked in to RoundTable or not, i can't complete the object to which this problem applies.
Example:
if test = true then
do:
function MyFunction returns logical
(input cTest as character):
end function.
end.
Comments
#1
Ok, bug confirmed. Thanks Onno!
The bug is that Prolint.p searches all internal procedures and functions (procedure BuildProcedureList in prolint.p) but it only looks at direct children of the program_root. I did not expect to find functions or internal procedures as children of executable statements, so the procedure does not look at that level.
I can fix that, but it will slow down the procedure a bit.
Perhaps we should also have a new Prolint rule that says that you are defining a function/ip inside an executable statement.
#2
Fixed. Prolint will now correctly find the function that was defined inside the code_block.
Also: added a new rule (nestedfunc) that barfs because you have defined a function inside a code_block. So you are still not off the hook, Onno! :-)
#3