diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-09-14 05:12:15 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-09-14 05:12:15 +0200 |
commit | c378bbe212ec5138198b5c0ea44cf8c7732b723e (patch) | |
tree | 777b2b677ce571326b7eeaf367e675f2e35999ee /src/vhdl/vhdl-sem_expr.adb | |
parent | 17f7e2236fddc3c9ff904fb3549634cf4df7fad2 (diff) | |
download | ghdl-c378bbe212ec5138198b5c0ea44cf8c7732b723e.tar.gz ghdl-c378bbe212ec5138198b5c0ea44cf8c7732b723e.tar.bz2 ghdl-c378bbe212ec5138198b5c0ea44cf8c7732b723e.zip |
vhdl-sem_expr.adb: adjust aggregate element type extraction. For #737
Diffstat (limited to 'src/vhdl/vhdl-sem_expr.adb')
-rw-r--r-- | src/vhdl/vhdl-sem_expr.adb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/vhdl/vhdl-sem_expr.adb b/src/vhdl/vhdl-sem_expr.adb index 59a167500..a70e197b9 100644 --- a/src/vhdl/vhdl-sem_expr.adb +++ b/src/vhdl/vhdl-sem_expr.adb @@ -3576,6 +3576,9 @@ package body Vhdl.Sem_Expr is end case; else New_El_Subtype := Get_Type (Sub_Aggr); + if not Get_Element_Type_Flag (Assoc) then + New_El_Subtype := Get_Element_Subtype (New_El_Subtype); + end if; -- TODO: try to extract the 'best' element subtype: with -- static indexes, with constrained sub-elements. -- Possibly create an hybrid subtype (for records). @@ -3662,8 +3665,10 @@ package body Vhdl.Sem_Expr is Sem_Array_Aggregate_Check_Element_Subtype (El_Subtype, Sub_Aggr, Dim + 1, Nbr_Dim); else - -- TODO: only report the first error ? - Check_Matching_Subtype (Sub_Aggr, El_Subtype); + if Get_Element_Type_Flag (Assoc) then + -- TODO: only report the first error ? + Check_Matching_Subtype (Sub_Aggr, El_Subtype); + end if; end if; end if; Assoc := Get_Chain (Assoc); |