Skip to content

Regression from 1.14.2: error: ambiguous use of operator "&" #1138

@FireFox317

Description

@FireFox317

The following code doesn't work in nvc 1.15.0, but does correctly work in 1.14.2. So, this seems to be a regression.

library ieee;
use ieee.std_logic_1164.all;

entity test is
end entity test;

architecture rtl of test is

    subtype slv64_type is std_logic_vector(0 to 63);
    type    slv64_array_type is array (natural range <>) of slv64_type;

    constant zeroes : std_logic_vector(0 to 31)  := x"00000000";
    constant more_zeroes : std_logic_vector(0 to 31) := x"00000000";

    -- doesn't work in nvc 1.15.0, works in nvc 1.14.2
    -- error: ambiguous use of operator "&"
    constant test_constant : slv64_array_type := (zeroes & more_zeroes, zeroes & more_zeroes);

begin
end architecture rtl;

Error when analyzing files:

** Error: ambiguous use of operator "&"
    > test.vhd:18
    |
 11 |     type    slv64_array_type is array (natural range <>) of slv64_type;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ candidate "&" [SLV64_TYPE, SLV64_TYPE return SLV64_ARRAY_TYPE]
 ...
 18 |     constant test_constant : slv64_array_type := (zeroes & more_zeroes, zeroes & more_zeroes);
    |                                                   ^^^^^^^^^^^^^^^^^^^^ use of name "&" here
    |
    = Note: candidate "&" [STD_ULOGIC_VECTOR, STD_ULOGIC_VECTOR return STD_ULOGIC_VECTOR] from IEEE.STD_LOGIC_1164
** Error: ambiguous use of operator "&"
    > test.vhd:18
    |
 11 |     type    slv64_array_type is array (natural range <>) of slv64_type;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ candidate "&" [SLV64_TYPE, SLV64_TYPE return SLV64_ARRAY_TYPE]
 ...
 18 |     constant test_constant : slv64_array_type := (zeroes & more_zeroes, zeroes & more_zeroes);
    |                                                                         ^^^^^^^^^^^^^^^^^^^^ use of name "&" here
    |
    = Note: candidate "&" [STD_ULOGIC_VECTOR, STD_ULOGIC_VECTOR return STD_ULOGIC_VECTOR] from IEEE.STD_LOGIC_1164

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions