pastojs: error on anynomous record

This commit is contained in:
mattias 2019-04-08 20:50:51 +00:00
parent 0ece012627
commit 772022ceb8
3 changed files with 16 additions and 0 deletions

View File

@ -3106,6 +3106,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

@ -462,6 +462,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
@ -10603,6 +10604,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);