package pkg3 is
generic (
type atyp;
function plus (a: atyp) return natural is <>);
function wrap (a : atyp) return natural;
end pkg3;
package body pkg3 is
function wrap (a : atyp) return natural is
begin
return plus (a);
end wrap;
end pkg3;
entity tb_pkg3 is
end;
architecture behav of tb_pkg3 is
function plus (a: bit_vector) return natural is
begin
return a'length;
end plus;
package my_pkg3 is new work.pkg3 generic map (atyp => bit_vector,
plus => open);
constant c : natural := my_pkg3.wrap("0101");
begin
assert c = 4 severity failure;
end behav;
$ nvc --std=08 --messages=compact -a --psl dda0e81e2592bf1451aa9f61f8628d12e5dabed99df89220ed4d174ca9b57c8b
debug: C runtime library: C:\WINDOWS\System32\ucrtbase.dll
Assertion failed: tree_kind(value) == T_REF, file ../src/sem.c, line 5200
The MWE is from https://github.com/ghdl/ghdl/issues/2163 https://github.com/ghdl/ghdl/blob/master/testsuite/gna/issue2163/pkg3.vhdl