diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 57c3230066..038226a04e 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -4708,8 +4708,16 @@ begin CreateChildNode; CurNode.Desc:=ctnIdentifier; CurNode.EndPos:=CurPos.EndPos; - EndChildNode; ReadNextAtom; + while CurPos.Flag = cafPoint do begin + // TMyClassClass = class of unit1.TMyClass + ReadNextAtom; + AtomIsIdentifierSaveE(20250403202500); + CurNode.EndPos:=CurPos.EndPos; + ReadNextAtom; + end; + EndChildNode; + ReadHintModifiers(False); if CurPos.Flag<>cafSemicolon then SaveRaiseCharExpectedButAtomFound(20170421195756,';'); end else begin diff --git a/components/codetools/tests/moduletests/fdt_classof.pas b/components/codetools/tests/moduletests/fdt_classof.pas index 9e52b3728f..3290dfa004 100644 --- a/components/codetools/tests/moduletests/fdt_classof.pas +++ b/components/codetools/tests/moduletests/fdt_classof.pas @@ -6,6 +6,7 @@ interface type TClassOfMy = class of TMy{declaration:fdt_classof.TMy}; + TClass1OfMy = class of TMy{declaration:fdt_classof.TMy} deprecated 'abc' experimental; { TMy } @@ -14,6 +15,8 @@ type class procedure Run; end; + TClass2OfMy = class of fdt_classof.TMy{declaration!:fdt_classof.TMy}; + procedure DoIt; implementation