aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2071/repro2.vhdl
blob: f006713108161180a23f944c809d23200c57fcb0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package TST_PKG is
    type Indices_t is array (natural range <>) of bit_vector;

    type Bus_t is record
        Indices : Indices_t;
    end record;

    function Init(
        TST_PKG_bus : Bus_t
    ) return Bus_t;

end package;

package body TST_PKG is
    function Init(
        TST_PKG_bus : Bus_t
    )
    return Bus_t is
        variable result : Bus_t(
            Indices(TST_PKG_bus.Indices'range)(TST_PKG_bus.Indices'element'range)
        );
    begin
        result.Indices := (others => (others => '0'));
        return result;
    end function Init;
end package body;

use work.tst_pkg.all;

entity repro2 is
end;

architecture arch of repro2 is
  constant c1 : bus_t := (indices => (1 to 4 => "01"));
  constant c2 : bus_t := init (c1);
begin
end;