diff options
author | Tristan Gingold | 2016-01-17 05:09:43 +0100 |
---|---|---|
committer | Tristan Gingold | 2016-01-19 19:54:40 +0100 |
commit | 8e2468448947c7e1567cc50035a483c2ebd7b9d9 (patch) | |
tree | 710b9937761529e69710b317b1cc2eff0bec2df5 | |
parent | c3c11edfccd3fca36417ad2ad60531272c3766aa (diff) | |
download | ghdl-8e2468448947c7e1567cc50035a483c2ebd7b9d9.tar.gz ghdl-8e2468448947c7e1567cc50035a483c2ebd7b9d9.tar.bz2 ghdl-8e2468448947c7e1567cc50035a483c2ebd7b9d9.zip |
Improve error message for variable assignment.
-rw-r--r-- | src/vhdl/sem_stmts.adb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vhdl/sem_stmts.adb b/src/vhdl/sem_stmts.adb index 6f93041..5e04cb4 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; |