mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 13:50:20 +02:00
* throw an error in iso/extended pascal mode if enum types are passed to writeln, resolves #40896
This commit is contained in:
parent
4b4e40dbc9
commit
0735ac0d1f
@ -850,6 +850,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
enumdef:
|
enumdef:
|
||||||
begin
|
begin
|
||||||
|
if m_isolike_io in current_settings.modeswitches then
|
||||||
|
begin
|
||||||
|
error_para := true;
|
||||||
|
CGMessagePos(para.fileinfo,type_e_cant_read_write_type);
|
||||||
|
end;
|
||||||
|
|
||||||
name:=procprefixes[do_read]+'enum';
|
name:=procprefixes[do_read]+'enum';
|
||||||
if do_read then
|
if do_read then
|
||||||
{ read is done with a var parameter so we need the correct
|
{ read is done with a var parameter so we need the correct
|
||||||
|
10
tests/webtbf/tw40896.pp
Normal file
10
tests/webtbf/tw40896.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ %fail }
|
||||||
|
{$mode extendedpascal}
|
||||||
|
type
|
||||||
|
fruits = (apple, banana, citrus);
|
||||||
|
var
|
||||||
|
a:fruits;
|
||||||
|
begin
|
||||||
|
Writeln(pred(high(a)));
|
||||||
|
ReadLn;
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user