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:
paul 2011-01-24 03:08:22 +00:00
parent 9499692eeb
commit 8102c480d7

View File

@ -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