aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-01-05 08:51:57 +0100
committerTristan Gingold <tgingold@free.fr>2018-01-05 08:57:19 +0100
commit2fcecf812f92da9571aa3233a27c328791f25f44 (patch)
treeb89155dc0f793f1872dd21cf0555fffd4bfc3850 /src
parent316236ea3aef0eadc9bb7cd7c8b5b811ede87b0f (diff)
downloadghdl-2fcecf812f92da9571aa3233a27c328791f25f44.tar.gz
ghdl-2fcecf812f92da9571aa3233a27c328791f25f44.tar.bz2
ghdl-2fcecf812f92da9571aa3233a27c328791f25f44.zip
Fix typo in error message.
Fix #516
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/sem_types.adb13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/vhdl/sem_types.adb b/src/vhdl/sem_types.adb
index cef868bcc..007b130f3 100644
--- a/src/vhdl/sem_types.adb
+++ b/src/vhdl/sem_types.adb
@@ -572,6 +572,10 @@ package body Sem_Types is
Inter : Iir;
Inter_Type : Iir;
begin
+ -- LRM08 3.5.1 Protected type declarations
+ -- Such formal parameters must not be of an access type or
+ -- a file type; moreover, they must not have a subelement
+ -- that is an access type of a file type.
Inter := Get_Interface_Declaration_Chain (El);
while Inter /= Null_Iir loop
Inter_Type := Get_Type (Inter);
@@ -586,14 +590,19 @@ package body Sem_Types is
end if;
Inter := Get_Chain (Inter);
end loop;
+
+ -- LRM08 3.5.1 Protected type declarations
+ -- Additionally, in the case of a function subprogram, the
+ -- return type of the function must not be of an access type
+ -- or file type; moreover, it must not have a subelement
+ -- that is an access type of a file type.
if Get_Kind (El) = Iir_Kind_Function_Declaration then
Inter_Type := Get_Return_Type (El);
if Inter_Type /= Null_Iir
and then Get_Signal_Type_Flag (Inter_Type) = False
then
Error_Msg_Sem
- (+El,
- "method return type must not be access of file");
+ (+El, "method cannot return an access or a file");
end if;
end if;
end;