mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-24 15:49:21 +02:00
+ variants can be used as cond. expr. in if, while, repeat ... until statements
This commit is contained in:
parent
627420ae56
commit
d266bc32d9
@ -372,7 +372,12 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
if not is_boolean(left.resulttype.def) then
|
if not is_boolean(left.resulttype.def) then
|
||||||
CGMessage1(type_e_boolean_expr_expected,left.resulttype.def.typename);
|
begin
|
||||||
|
if left.resulttype.def.deftype=variantdef then
|
||||||
|
inserttypeconv(left,booltype)
|
||||||
|
else
|
||||||
|
CGMessage1(type_e_boolean_expr_expected,left.resulttype.def.typename);
|
||||||
|
end;
|
||||||
|
|
||||||
{ optimize constant expressions }
|
{ optimize constant expressions }
|
||||||
if (left.nodetype=ordconstn) then
|
if (left.nodetype=ordconstn) then
|
||||||
@ -554,7 +559,12 @@ implementation
|
|||||||
exit;
|
exit;
|
||||||
|
|
||||||
if not is_boolean(left.resulttype.def) then
|
if not is_boolean(left.resulttype.def) then
|
||||||
Message1(type_e_boolean_expr_expected,left.resulttype.def.typename);
|
begin
|
||||||
|
if left.resulttype.def.deftype=variantdef then
|
||||||
|
inserttypeconv(left,booltype)
|
||||||
|
else
|
||||||
|
Message1(type_e_boolean_expr_expected,left.resulttype.def.typename);
|
||||||
|
end;
|
||||||
|
|
||||||
{ optimize constant expressions }
|
{ optimize constant expressions }
|
||||||
if left.nodetype=ordconstn then
|
if left.nodetype=ordconstn then
|
||||||
@ -1394,7 +1404,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.109 2005-02-14 17:13:06 peter
|
Revision 1.110 2005-02-23 20:38:09 florian
|
||||||
|
+ variants can be used as cond. expr. in if, while, repeat ... until statements
|
||||||
|
|
||||||
|
Revision 1.109 2005/02/14 17:13:06 peter
|
||||||
* truncate log
|
* truncate log
|
||||||
|
|
||||||
Revision 1.108 2005/01/31 20:23:53 peter
|
Revision 1.108 2005/01/31 20:23:53 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user