pastojs: error on anynomous record

git-svn-id: trunk@41851 -
This commit is contained in:
Mattias Gaertner 2019-04-08 20:49:04 +00:00
parent 851740a945
commit 22777fee94
3 changed files with 16 additions and 0 deletions

View File

@ -3191,6 +3191,8 @@ end;
procedure TPas2JSResolver.AddRecordType(El: TPasRecordType);
begin
inherited;
if El.Name='' then
RaiseNotYetImplemented(20190408224556,El,'anonymous record type');
if El.Parent is TProcedureBody then
// local record
AddElevatedLocal(El);

View File

@ -1915,6 +1915,7 @@ var
i: Integer;
aFilename: String;
begin
//writeln('TPas2jsFilesCache.FindUnitFileName "',aUnitname,'" ModuleDir="',ModuleDir,'"');
Result:='';
IsForeign:=false;
SearchedDirs:=TStringList.Create;

View File

@ -461,6 +461,7 @@ type
Procedure TestRecord_Const;
Procedure TestRecord_TypecastFail;
Procedure TestRecord_InFunction;
Procedure TestRecord_AnonymousFail;
// ToDo: RTTI of local record
// ToDo: pcu local record, name clash and rtti
@ -10601,6 +10602,18 @@ begin
'']));
end;
procedure TTestModule.TestRecord_AnonymousFail;
begin
StartProgram(false);
Add([
'var',
' r: record x: word end;',
'begin']);
SetExpectedPasResolverError('not yet implemented: :TPasRecordType [20190408224556] anonymous record type',
nNotYetImplemented);
ConvertProgram;
end;
procedure TTestModule.TestAdvRecord_Function;
begin
StartProgram(false);