fcl-passrc: resolver: check arg access

This commit is contained in:
mattias 2019-10-18 21:59:44 +00:00
parent 0a6f1171ec
commit 2ec7063007
2 changed files with 13 additions and 0 deletions

View File

@ -10537,6 +10537,8 @@ begin
{$IFDEF VerbosePasResolver}
writeln('TPasResolver.AddArgument ',GetObjName(El));
{$ENDIF}
if El.Access in [argDefault,argConst,argVar,argOut] then
RaiseNotYetImplemented(20191018235644,El,AccessNames[El.Access]);
CurScope:=TopScope;
if (CurScope=nil) then
RaiseInvalidScopeForElement(20160922163529,El);

View File

@ -381,6 +381,7 @@ type
// procs
Procedure TestProcParam;
Procedure TestProcParamAccess;
Procedure TestProcParamConstRefFail;
Procedure TestFunctionResult;
Procedure TestProcedureResultFail;
Procedure TestProc_ArgVarPrecisionLossFail;
@ -5986,6 +5987,16 @@ begin
ParseProgram;
end;
procedure TTestResolver.TestProcParamConstRefFail;
begin
StartProgram(false);
Add('procedure Run(constref a: word);');
Add('begin');
Add('end;');
Add('begin');
CheckResolverException('not yet implemented: a:TPasArgument [20191018235644]',nNotYetImplemented);
end;
procedure TTestResolver.TestFunctionResult;
begin
StartProgram(false);