aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vhdl/vhdl-sem_assocs.adb15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-sem_assocs.adb b/src/vhdl/vhdl-sem_assocs.adb
index 47f45c380..74faad959 100644
--- a/src/vhdl/vhdl-sem_assocs.adb
+++ b/src/vhdl/vhdl-sem_assocs.adb
@@ -1325,10 +1325,23 @@ package body Vhdl.Sem_Assocs is
if Is_Valid_Conversion (Conv, Res_Base_Type, Param_Base_Type) then
Res := Conv;
else
- Res := Null_Iir;
Error_Msg_Sem (+Loc, "conversion function or type does not match");
+ return Null_Iir;
end if;
end if;
+
+ if Get_Kind (Res) = Iir_Kind_Function_Call then
+ declare
+ Imp : constant Iir := Get_Implementation (Res);
+ Inter : constant Iir := Get_Interface_Declaration_Chain (Imp);
+ begin
+ if Get_Kind (Inter) /= Iir_Kind_Interface_Constant_Declaration then
+ Error_Msg_Sem
+ (+Loc, "interface of function must be a constant interface");
+ end if;
+ end;
+ end if;
+
return Res;
end Extract_Conversion;