|
@@ -5428,8 +5428,16 @@ function TPasResolver.AddIdentifier(Scope: TPasIdentifierScope;
|
|
while Identifier<>nil do
|
|
while Identifier<>nil do
|
|
begin
|
|
begin
|
|
CurEl:=Identifier.Element;
|
|
CurEl:=Identifier.Element;
|
|
- if not (CurEl is TPasGenericType) then break;
|
|
|
|
- if GetTypeParameterCount(TPasGenericType(CurEl))=TypeParamCnt then break;
|
|
|
|
|
|
+ if CurEl is TPasGenericType then
|
|
|
|
+ begin
|
|
|
|
+ if GetTypeParameterCount(TPasGenericType(CurEl))=TypeParamCnt then
|
|
|
|
+ break;
|
|
|
|
+ end
|
|
|
|
+ else
|
|
|
|
+ begin
|
|
|
|
+ if TypeParamCnt=0 then
|
|
|
|
+ break;
|
|
|
|
+ end;
|
|
Identifier:=Identifier.NextSameIdentifier;
|
|
Identifier:=Identifier.NextSameIdentifier;
|
|
end;
|
|
end;
|
|
Result:=Identifier;
|
|
Result:=Identifier;
|
|
@@ -5506,7 +5514,7 @@ begin
|
|
|
|
|
|
// check duplicate in current scope
|
|
// check duplicate in current scope
|
|
OlderIdentifier:=Identifier.NextSameIdentifier;
|
|
OlderIdentifier:=Identifier.NextSameIdentifier;
|
|
- if IsGeneric then
|
|
|
|
|
|
+ if IsGeneric and (msDelphi in CurrentParser.CurrentModeswitches) then
|
|
OlderIdentifier:=SkipGenericTypes(OlderIdentifier,TypeParamCnt);
|
|
OlderIdentifier:=SkipGenericTypes(OlderIdentifier,TypeParamCnt);
|
|
if OlderIdentifier<>nil then
|
|
if OlderIdentifier<>nil then
|
|
begin
|
|
begin
|
|
@@ -20387,7 +20395,7 @@ begin
|
|
else
|
|
else
|
|
NeedPop:=false;
|
|
NeedPop:=false;
|
|
|
|
|
|
- if (TypeParamCount>0) and (RightPath='') then
|
|
|
|
|
|
+ if (RightPath='') and (TypeParamCount>0) then
|
|
begin
|
|
begin
|
|
NextEl:=FindGenericEl(CurName,TypeParamCount,FindData,ErrorEl);
|
|
NextEl:=FindGenericEl(CurName,TypeParamCount,FindData,ErrorEl);
|
|
if (FindData.StartScope<>nil) and (FindData.StartScope.ClassType=ScopeClass_WithExpr)
|
|
if (FindData.StartScope<>nil) and (FindData.StartScope.ClassType=ScopeClass_WithExpr)
|