Bug: Private Method declarations in package body appear twice

Not sure if this is a bug, but it is strange behaviour if not.
Usually, in a package, I declare a method (function/procedure) in the package, and then the code appears in the package body.

I have just discovered that you can have private methods, where the declaration goes in the top of the package body and the actual method goes at the bottom.

However, when I do this the contents pane/tree shows each method twice. I would have expected the declarations to appear in the 'Declaration' folder/node, and not mixed in with all the others.

Would you agree?
 
I wanted to add a "me too" to this. Putting the method declarations in the "Declaration" folder that already exists seems perfect to me. (Probably because I never open that folder.)
 
I always try to avoid making seperate declarations of methods (procedures and functions), for several reasons:
  • when you change a for instance a parameter, you have to do it in two places
  • when you ctrl-right-click on a method name to navigate to the package body, the cursor is placed on the first declaration of the method, i.e. in the declaration and not the implementation where the most interesting things usually happen
  • as you state, they appear two times in the program window, this could of course be coded differently
Under normal circumstances, there is no need to define seperate declarations for functions or procedures. If a procedure/function is implemented before the place where it is called it will compile. Only in rare cases, for instance recursive coding or others where procedure A calls B and procedure B calls A, a forward declaration is required.
 
Back
Top