mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-11 14:49:28 +02:00
FpDebug: Conditionals (?IF or Try/N) must flag variant returns in slices
This commit is contained in:
parent
0c424bf0be
commit
c4deaeadcf
@ -519,6 +519,8 @@ type
|
||||
): TFpPascalExpressionPart; override;
|
||||
function IsValidAfterPartWithPrecedence(APrevPart: TFpPascalExpressionPart): Boolean; override;
|
||||
procedure DoHandleEndOfExpression; override;
|
||||
public
|
||||
function ReturnsVariant: boolean; override;
|
||||
end;
|
||||
|
||||
{ TFpPascalExpressionPartOperatorColon }
|
||||
@ -3433,7 +3435,8 @@ end;
|
||||
function TFpPascalExpressionPartIntrinsic.ReturnsVariant: boolean;
|
||||
begin
|
||||
Result := (inherited ReturnsVariant) or
|
||||
(FIntrinsic = ifChildClass);
|
||||
(FIntrinsic in [ifChildClass, ifTry, ifTryN]);
|
||||
// TODO: compare types of each argument for ifTry/N
|
||||
end;
|
||||
|
||||
procedure TFpPascalExpressionPartIntrinsic.HandleNewParam(AParamPart: TFpPascalExpressionPart;
|
||||
@ -5117,6 +5120,11 @@ begin
|
||||
SetError('Missing ":"');
|
||||
end;
|
||||
|
||||
function TFpPascalExpressionPartOperatorQuestionMark.ReturnsVariant: boolean;
|
||||
begin
|
||||
Result := True; // TODO: compare types of each argument
|
||||
end;
|
||||
|
||||
{ TFpPascalExpressionPartOperatorColon }
|
||||
|
||||
procedure TFpPascalExpressionPartOperatorColon.Init;
|
||||
|
Loading…
Reference in New Issue
Block a user