diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-05-02 09:43:06 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-05-02 09:43:06 +0200 |
commit | 6fe280aa0955f78a832d74030b20fe6d64f5d428 (patch) | |
tree | dbee6bdc3ba6fc2ed1828c4adb347c5a070edb54 /src/vhdl/vhdl-sem_expr.adb | |
parent | 8c2dc4b2082ec2bf6f28f44218521f4fbe9bf9d7 (diff) | |
download | ghdl-6fe280aa0955f78a832d74030b20fe6d64f5d428.tar.gz ghdl-6fe280aa0955f78a832d74030b20fe6d64f5d428.tar.bz2 ghdl-6fe280aa0955f78a832d74030b20fe6d64f5d428.zip |
vhdl-sem_expr: fix handling of overload lists in merge_wildcard_type. Fix #1274
Diffstat (limited to 'src/vhdl/vhdl-sem_expr.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_expr.adb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb index 3dd6cd304..51a6549c8 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -5120,16 +5120,21 @@ package body Vhdl.Sem_Expr is return; end if; - -- Use the base type; EXPR may define its own subtype (like in - -- qualified expression with forwarding) which must not be referenced - -- above it. In any case, that also makes sense: we need to deal with - -- types, not with subtypes. - Expr_Type := Get_Base_Type (Get_Type (Expr)); + Expr_Type := Get_Type (Expr); if Is_Error (Expr_Type) then return; end if; - pragma Assert (Expr_Type /= Null_Iir); + if not Is_Overload_List (Expr_Type) then + -- Use the base type; EXPR may define its own subtype (like in + -- qualified expression with forwarding) which must not be + -- referenced before it is defined (so by a parent). In any case, + -- that also makes sense: we need to deal with types, not with + -- subtypes. + Expr_Type := Get_Base_Type (Expr_Type); + pragma Assert (Expr_Type /= Null_Iir); + end if; + Result_Type := Compatible_Types_Intersect (Atype, Expr_Type); if Atype /= Null_Iir and then Is_Overload_List (Atype) then Free_Overload_List (Atype); |