mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
fcl-passrc: resolver: fixed error when accessing element of forward class
This commit is contained in:
parent
0c9b622a74
commit
653303274f
@ -21396,6 +21396,9 @@ begin
|
||||
and not IsFullySpecialized(TPasGenericType(CurScopeEl)) then
|
||||
RaiseMsg(20200217131215,nGenericsWithoutSpecializationAsType,
|
||||
sGenericsWithoutSpecializationAsType,['reference'],ErrorEl);
|
||||
if (CurScopeEl is TPasClassType) and TPasClassType(CurScopeEl).IsForward then
|
||||
RaiseMsg(20220527113900,nIdentifierNotFound,
|
||||
sIdentifierNotFound,[CurName],ErrorEl);
|
||||
CurScope:=PushDotScope(TPasType(CurScopeEl));
|
||||
if CurScope=nil then
|
||||
RaiseMsg(20190122122529,nIllegalQualifierAfter,sIllegalQualifierAfter,
|
||||
|
@ -562,6 +562,7 @@ type
|
||||
Procedure TestClassForwardDelphiFail;
|
||||
Procedure TestClassForwardObjFPCProgram;
|
||||
Procedure TestClassForwardObjFPCUnit;
|
||||
Procedure TestClassForwardNestedTypeFail;
|
||||
Procedure TestClass_Method;
|
||||
Procedure TestClass_ConstructorMissingDotFail;
|
||||
Procedure TestClass_MethodImplDuplicateFail;
|
||||
@ -9519,6 +9520,23 @@ begin
|
||||
ParseUnit;
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestClassForwardNestedTypeFail;
|
||||
begin
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'type',
|
||||
' TObject = class',
|
||||
' end;',
|
||||
' TBird = class;',
|
||||
' TProc = procedure(a: TBird.TEnum);',
|
||||
' TBird = class',
|
||||
' type TEnum = (red,blue);',
|
||||
' end;',
|
||||
'begin',
|
||||
'']);
|
||||
CheckResolverException('identifier not found "TEnum"',nIdentifierNotFound);
|
||||
end;
|
||||
|
||||
procedure TTestResolver.TestClass_Method;
|
||||
begin
|
||||
StartProgram(false);
|
||||
|
Loading…
Reference in New Issue
Block a user