The Standard is quite clear on forbidding this:
Within a source element, a given user-defined word may be used as only one type of user-defined word with the following exceptions:
- a compilation-variable-name may be the same as any other type of user-defined word
- a level-number may be the same as a paragraph-name or a section-name
- the same name may be used as any of the following types of user-defined words:
- constant-name
- data-name
- property-name
- record-key-name
- record-name
At least ACUCOBOL allows the same name in variables and sections paragraphs. I think it would be useful to add a compiler configuration for this, if it is set all paragraphs may get an internal prefix (both on creation and on references) or the reference lookup verifies the type of the reference.
You might want to examine [r1047] and [bugs:#268], which involved the similar problem of allowing redefinition of program-names. However, this problem was mixed up with basic program prototype support, so the [r1047] diff is quite hard to read.
Related
Bugs:
#268Last edit: Edward Hart 2017-07-27
Closed in favor of [feature-requests:#260].
Related
Wish List: #260