mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 08:48:08 +02:00
pastojs: filer: warn for generics
git-svn-id: trunk@43690 -
This commit is contained in:
parent
c8a3a11a26
commit
12084211bf
@ -3920,6 +3920,13 @@ begin
|
||||
WritePasElement(Obj,El,aContext);
|
||||
Scope:=El.CustomData as TPas2JSProcedureScope;
|
||||
//writeln('TPCUWriter.WriteProcedure ',GetObjName(El),' ',GetObjName(Scope),' ',Resolver.GetElementSourcePosStr(El));
|
||||
|
||||
if Scope.SpecializedFromItem<>nil then
|
||||
begin
|
||||
// ToDo: write spezialiation signature
|
||||
RaiseMsg(20191120180305,El,GetObjPath(Scope.SpecializedFromItem.FirstSpecialize));
|
||||
end;
|
||||
|
||||
if Scope.DeclarationProc=nil then
|
||||
begin
|
||||
// declaration
|
||||
|
@ -172,7 +172,8 @@ type
|
||||
procedure TestPC_ClassInterface;
|
||||
procedure TestPC_Attributes;
|
||||
|
||||
procedure TestPC_GenericFunction;
|
||||
procedure TestPC_GenericClassSkip; // ToDo
|
||||
procedure TestPC_GenericFunctionSkip;
|
||||
|
||||
procedure TestPC_UseUnit;
|
||||
procedure TestPC_UseUnit_Class;
|
||||
@ -2406,7 +2407,31 @@ begin
|
||||
WriteReadUnit;
|
||||
end;
|
||||
|
||||
procedure TTestPrecompile.TestPC_GenericFunction;
|
||||
procedure TTestPrecompile.TestPC_GenericClassSkip;
|
||||
begin
|
||||
exit;
|
||||
|
||||
StartUnit(false);
|
||||
Add([
|
||||
'interface',
|
||||
'type',
|
||||
' TObject = class',
|
||||
' end;',
|
||||
' generic TBird<T> = class',
|
||||
' a: T;',
|
||||
' generic function Run<T>(a: T): T;',
|
||||
' end;',
|
||||
'implementation',
|
||||
'function TBird.Run<T>(a: T): T;',
|
||||
'var b: T;',
|
||||
'begin',
|
||||
' b:=a; Result:=b;',
|
||||
'end;',
|
||||
'']);
|
||||
WriteReadUnit;
|
||||
end;
|
||||
|
||||
procedure TTestPrecompile.TestPC_GenericFunctionSkip;
|
||||
begin
|
||||
StartUnit(false);
|
||||
Add([
|
||||
|
Loading…
Reference in New Issue
Block a user