From 8e2468448947c7e1567cc50035a483c2ebd7b9d9 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 17 Jan 2016 05:09:43 +0100 Subject: Improve error message for variable assignment. --- src/vhdl/sem_stmts.adb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vhdl/sem_stmts.adb b/src/vhdl/sem_stmts.adb index 6f93041ef..5e04cb494 100644 --- a/src/vhdl/sem_stmts.adb +++ b/src/vhdl/sem_stmts.adb @@ -272,7 +272,8 @@ package body Sem_Stmts is if Get_Kind (Ass) = Iir_Kind_Aggregate then Check_Aggregate_Target (Stmt, Ass, Nbr); else - if Get_Kind (Stmt) = Iir_Kind_Variable_Assignment_Statement + if Get_Kind (Stmt) in + Iir_Kinds_Variable_Assignment_Statement then Check_Simple_Variable_Target (Stmt, Ass, Locally); else @@ -847,6 +848,10 @@ package body Sem_Stmts is exit when Done; if not Is_Defined_Type (Stmt_Type) then Error_Msg_Sem ("cannot resolve type", Stmt); + if Get_Kind (Target) = Iir_Kind_Aggregate then + -- Try to give an advice. + Error_Msg_Sem ("use a qualified expression for the RHS", Stmt); + end if; exit; end if; end loop; -- cgit v1.2.3