summaryrefslogtreecommitdiff
path: root/sem_specs.adb
diff options
context:
space:
mode:
authorTristan Gingold2014-06-21 02:57:50 +0200
committerTristan Gingold2014-06-21 02:57:50 +0200
commitdc45124d37fb77f49d35e2500694725787877157 (patch)
treef816cec934fda5b338e28a4bfaa8fd5a68c060ac /sem_specs.adb
parent76f5de492f91bf751b386072a67f78db83bd53b8 (diff)
downloadghdl-dc45124d37fb77f49d35e2500694725787877157.tar.gz
ghdl-dc45124d37fb77f49d35e2500694725787877157.tar.bz2
ghdl-dc45124d37fb77f49d35e2500694725787877157.zip
improve error message for error in default binding.
Diffstat (limited to 'sem_specs.adb')
-rw-r--r--sem_specs.adb34
1 files changed, 26 insertions, 8 deletions
diff --git a/sem_specs.adb b/sem_specs.adb
index b746a34..56dbd9e 100644
--- a/sem_specs.adb
+++ b/sem_specs.adb
@@ -1475,18 +1475,36 @@ package body Sem_Specs is
Location_Copy (Assoc, Parent);
else
if not Are_Nodes_Compatible (Comp_El, Ent_El) then
+ if not Error then
+ Error_Msg_Sem
+ ("for default port binding of " & Disp_Node (Parent)
+ & ":", Parent);
+ end if;
Error_Msg_Sem
- ("type of "
- & Disp_Node (Comp_El) & " from " & Disp_Node (Comp)
- & " and "
- & Disp_Node (Ent_El) & " from " & Disp_Node (Entity)
- & " are not compatible for an association",
- Parent);
+ ("type of " & Disp_Node (Comp_El)
+ & " declarared at " & Disp_Location (Comp_El), Parent);
+ Error_Msg_Sem
+ ("not compatible with type of " & Disp_Node (Ent_El)
+ & " declarared at " & Disp_Location (Ent_El), Parent);
Error := True;
elsif Kind = Map_Port
- and then
- not Check_Port_Association_Restriction (Ent_El, Comp_El, Parent)
+ and then not Check_Port_Association_Restriction
+ (Ent_El, Comp_El, Null_Iir)
then
+ if not Error then
+ Error_Msg_Sem
+ ("for default port binding of " & Disp_Node (Parent)
+ & ":", Parent);
+ end if;
+ Error_Msg_Sem
+ ("cannot associate "
+ & Get_Mode_Name (Get_Mode (Ent_El))
+ & " " & Disp_Node (Ent_El)
+ & " declarared at " & Disp_Location (Ent_El), Parent);
+ Error_Msg_Sem
+ ("with actual port of mode "
+ & Get_Mode_Name (Get_Mode (Comp_El))
+ & " declared at " & Disp_Location (Comp_El), Parent);
Error := True;
end if;
Assoc := Create_Iir (Iir_Kind_Association_Element_By_Expression);