2
0
Эх сурвалжийг харах

fcl-passrc: fixed isspecialized test

git-svn-id: trunk@44387 -
Mattias Gaertner 5 жил өмнө
parent
commit
2ae212164e

+ 8 - 1
packages/fcl-passrc/src/pasresolver.pp

@@ -2324,6 +2324,7 @@ type
       Params: TFPList): TPasElement; virtual;
     procedure FinishSpecializedClassOrRecIntf(Scope: TPasGenericScope); virtual;
     procedure FinishSpecializations(Scope: TPasGenericScope); virtual;
+    function IsSpecialized(El: TPasGenericType): boolean; overload;
     function IsFullySpecialized(El: TPasGenericType): boolean; overload;
     function IsFullySpecialized(Proc: TPasProcedure): boolean; overload;
     function IsInterfaceType(const ResolvedEl: TPasResolverResult;
@@ -27943,7 +27944,7 @@ var
   ProcScope: TPasProcedureScope;
 begin
   Result:=nil;
-  if El.CustomData<>nil then
+  if (El.ClassType=TPasSpecializeType) and (El.CustomData<>nil) then
     RaiseNotYetImplemented(20190726142522,El);
 
   // check if there is already such a specialization
@@ -28099,6 +28100,12 @@ begin
     SpecializeGenericImpl(TPRSpecializedItem(SpecializedItems[i]));
 end;
 
+function TPasResolver.IsSpecialized(El: TPasGenericType): boolean;
+begin
+  Result:=(El<>nil) and (El.CustomData is TPasGenericScope)
+      and (TPasGenericScope(El.CustomData).SpecializedFromItem<>nil);
+end;
+
 function TPasResolver.IsFullySpecialized(El: TPasGenericType): boolean;
 var
   GenScope: TPasGenericScope;

+ 1 - 1
packages/fcl-passrc/src/pastree.pp

@@ -2981,7 +2981,7 @@ function TPasElement.GetModule: TPasModule;
 Var
   p : TPaselement;
 begin
-  if self is  TPasPackage then
+  if Self is TPasPackage then
     Result := nil
   else
     begin