mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 02:32:51 +02:00
compiler: generate an error message if enumerator operator is declared with return object which has no valid MoveNext method, Current property
git-svn-id: trunk@16806 -
This commit is contained in:
parent
9499692eeb
commit
8102c480d7
@ -445,6 +445,19 @@ implementation
|
||||
begin
|
||||
result:=
|
||||
is_class_or_interface_or_object(pf.returndef);
|
||||
if result then
|
||||
begin
|
||||
if not assigned(tobjectdef(pf.returndef).search_enumerator_move) then
|
||||
begin
|
||||
Message1(sym_e_no_enumerator_move, pf.returndef.typename);
|
||||
result:=false;
|
||||
end;
|
||||
if not assigned(tobjectdef(pf.returndef).search_enumerator_current) then
|
||||
begin
|
||||
Message1(sym_e_no_enumerator_current,pf.returndef.typename);
|
||||
result:=false;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user