STWA2-Ambiguous unit references

Top  Previous  Next


Ambiguous unit references (STWA2)


This sections lists identifiers with ambiguous unit references.

Consider this example:




What will be the output from the program? In this case, it will be “Goodbye”, because the last unit listed in the uses clause will have precedence.


The reference to TheValue is ambiguous or unclear, so it will be listed in this report section. Consider what happens if originally only unit “A” was listed in the uses clause. Then the output would be “Hello”. If then maybe another programmer without any sense of danger will add “B” to the uses clause, the output will be changed.


You should prefix the reference, like “B.TheValue”, to avoid any uncertainty.



See also: