mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-16 12:49:17 +02:00
fcl-passrc: resolver: ord(integer)
git-svn-id: trunk@48236 -
This commit is contained in:
parent
7a3eb453d4
commit
af5a6cd9d2
@ -19136,19 +19136,19 @@ begin
|
||||
exit(cIncompatible);
|
||||
Params:=TParamsExpr(Expr);
|
||||
|
||||
// first param: bool, enum or char
|
||||
// first param: bool, integer, enum or char
|
||||
Param:=Params.Params[0];
|
||||
ComputeElement(Param,ParamResolved,[]);
|
||||
Result:=cIncompatible;
|
||||
if rrfReadable in ParamResolved.Flags then
|
||||
begin
|
||||
if ParamResolved.BaseType in (btAllBooleans+btAllChars) then
|
||||
if ParamResolved.BaseType in btArrayRangeTypes then
|
||||
Result:=cExact
|
||||
else if (ParamResolved.BaseType=btContext) and (ParamResolved.LoTypeEl is TPasEnumType) then
|
||||
Result:=cExact
|
||||
else if ParamResolved.BaseType=btRange then
|
||||
begin
|
||||
if ParamResolved.SubType in btAllBooleans+btAllChars then
|
||||
if ParamResolved.SubType in btArrayRangeTypes then
|
||||
Result:=cExact
|
||||
else if ParamResolved.SubType=btContext then
|
||||
begin
|
||||
|
@ -3359,8 +3359,10 @@ begin
|
||||
' i2: TInt2;',
|
||||
'begin',
|
||||
' i:=i2;',
|
||||
' if i=i2 then ;']);
|
||||
' if i=i2 then ;',
|
||||
' i:=ord(i);']);
|
||||
ParseProgram;
|
||||
CheckResolverUnexpectedHints;
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestIntegerRangeHighLowerLowFail;
|
||||
|
Loading…
Reference in New Issue
Block a user