From 5034dc1b56603f177dbb37ad83d9538cbb737290 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 2 Dec 2020 13:59:47 +0000 Subject: [PATCH] pastojs: delayed inits only for fully specialized types --- compiler/packages/pastojs/src/fppas2js.pp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/packages/pastojs/src/fppas2js.pp b/compiler/packages/pastojs/src/fppas2js.pp index 10ba370..ac5a972 100644 --- a/compiler/packages/pastojs/src/fppas2js.pp +++ b/compiler/packages/pastojs/src/fppas2js.pp @@ -5222,6 +5222,7 @@ begin El:=SpecializedItem.SpecializedEl; if (El is TPasGenericType) + and IsFullySpecialized(TPasGenericType(El)) and (SpecializeParamsNeedDelay(SpecializedItem)<>nil) then TPas2JSResolverHub(Hub).AddJSDelaySpecialize(TPasGenericType(El)); @@ -17577,6 +17578,8 @@ var aResolver: TPas2JSResolver; begin if not IsElementUsed(El) then exit; + if not AContext.Resolver.IsFullySpecialized(El) then + RaiseNotSupported(El,AContext,20201202145045,'not fully specialized, probably a bug in the analyzer'); if not SpecializeNeedsDelay(El,AContext) then exit; C:=El.ClassType; if (C=TPasRecordType)