multiple declaration of types / constants

PROBLEM: two different packages with the same type / constant definition:

package PACK1 is
   type TYPE_ABC is ....;
 
   constant CONST_XYZ : ....;
   ....
end package PACK1;
 
package PACK2 is
   type TYPE_ABC is ....;
 
   constant CONST_XYZ : ....;
   ....
end package PACK2;

In another file, both of the packages are used. When defining a signal with the type TYPE_ABC or refering to CONST_XYZ there is an error note that the type / constant could not be found.

There should be an error note that there is a multiple declaration of the type / constant

multiple declaration of types / constants

The error is indeed not entirely clear. I think we should give a warning at the use clause that the declaration of a is not visible.

package p1 is
    constant a : integer := 1;	
end package p1;
 
package p2 is
    constant a : integer := 2;  
end package p2;
 
use work.p1.all; --Expect warning about a here
use work.p2.all; --Expect warning about a here
 
package p3 is
	constant b : integer := work.p1.a; --OK
	constant c : integer := work.p2.a; --OK
	constant d : integer := a; --expect error here
end package p3;

Logged as ticket:813

Fixed

ticket:813 has been fixed in the latest release. The VHDL editor view now gives much better warnings and error messages when multiple declarations with the same name are used and become invisible.

Post new comment

The content of this field is kept private and will not be shown publicly.
By submitting this form, you accept the Mollom privacy policy.