|
@@ -5155,6 +5155,7 @@ var
|
|
Proc: TPasProcedure;
|
|
Proc: TPasProcedure;
|
|
Store, SameScope: Boolean;
|
|
Store, SameScope: Boolean;
|
|
ProcScope: TPasProcedureScope;
|
|
ProcScope: TPasProcedureScope;
|
|
|
|
+ CurResolver: TPasResolver;
|
|
|
|
|
|
procedure CountProcInSameScope;
|
|
procedure CountProcInSameScope;
|
|
begin
|
|
begin
|
|
@@ -5188,7 +5189,7 @@ begin
|
|
fpkProc:
|
|
fpkProc:
|
|
// proc hides a non proc
|
|
// proc hides a non proc
|
|
if (Data^.Proc.GetModule=El.GetModule) then
|
|
if (Data^.Proc.GetModule=El.GetModule) then
|
|
- // forbidden within same module
|
|
|
|
|
|
+ // forbidden within same CurModule
|
|
RaiseMsg(20170216151649,nDuplicateIdentifier,sDuplicateIdentifier,
|
|
RaiseMsg(20170216151649,nDuplicateIdentifier,sDuplicateIdentifier,
|
|
[El.Name,GetElementSourcePosStr(El)],Data^.Proc.ProcType)
|
|
[El.Name,GetElementSourcePosStr(El)],Data^.Proc.ProcType)
|
|
else
|
|
else
|
|
@@ -5205,8 +5206,15 @@ begin
|
|
end;
|
|
end;
|
|
fpkMethod:
|
|
fpkMethod:
|
|
// method hides a non proc
|
|
// method hides a non proc
|
|
- RaiseMsg(20171118232543,nDuplicateIdentifier,sDuplicateIdentifier,
|
|
|
|
- [El.Name,GetElementSourcePosStr(El)],Data^.Proc.ProcType);
|
|
|
|
|
|
+ begin
|
|
|
|
+ ProcScope:=TPasProcedureScope(Data^.Proc.CustomData);
|
|
|
|
+ CurResolver:=ProcScope.Owner as TPasResolver;
|
|
|
|
+ if msDelphi in CurResolver.CurrentParser.CurrentModeswitches then
|
|
|
|
+ // ok in delphi
|
|
|
|
+ else
|
|
|
|
+ RaiseMsg(20171118232543,nDuplicateIdentifier,sDuplicateIdentifier,
|
|
|
|
+ [El.Name,GetElementSourcePosStr(El)],Data^.Proc.ProcType);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
exit;
|
|
exit;
|
|
end;
|
|
end;
|
|
@@ -5491,9 +5499,12 @@ var
|
|
i, TypeParamCnt: Integer;
|
|
i, TypeParamCnt: Integer;
|
|
OtherScope: TPasIdentifierScope;
|
|
OtherScope: TPasIdentifierScope;
|
|
ParentScope: TPasScope;
|
|
ParentScope: TPasScope;
|
|
- IsGeneric: Boolean;
|
|
|
|
|
|
+ IsGeneric, IsDelphi: Boolean;
|
|
begin
|
|
begin
|
|
if aName='' then exit(nil);
|
|
if aName='' then exit(nil);
|
|
|
|
+
|
|
|
|
+ IsDelphi:=msDelphi in CurrentParser.CurrentModeswitches;
|
|
|
|
+
|
|
if Scope is TPasGroupScope then
|
|
if Scope is TPasGroupScope then
|
|
begin
|
|
begin
|
|
Group:=TPasGroupScope(Scope);
|
|
Group:=TPasGroupScope(Scope);
|
|
@@ -5523,7 +5534,8 @@ begin
|
|
RaiseMsg(20170403223024,nSymbolCannotBePublished,sSymbolCannotBePublished,[],El);
|
|
RaiseMsg(20170403223024,nSymbolCannotBePublished,sSymbolCannotBePublished,[],El);
|
|
end;
|
|
end;
|
|
|
|
|
|
- if (Kind=pikSimple) and (Group<>nil) and (El.ClassType<>TPasProperty) then
|
|
|
|
|
|
+ if (Kind=pikSimple) and (Group<>nil) and (El.ClassType<>TPasProperty)
|
|
|
|
+ and not IsDelphi then
|
|
begin
|
|
begin
|
|
// check duplicate in ancestors and helpers
|
|
// check duplicate in ancestors and helpers
|
|
for i:=1 to Group.Count-1 do
|
|
for i:=1 to Group.Count-1 do
|
|
@@ -5554,7 +5566,7 @@ begin
|
|
|
|
|
|
// check duplicate in current scope
|
|
// check duplicate in current scope
|
|
OlderIdentifier:=Identifier.NextSameIdentifier;
|
|
OlderIdentifier:=Identifier.NextSameIdentifier;
|
|
- if IsGeneric and (msDelphi in CurrentParser.CurrentModeswitches) then
|
|
|
|
|
|
+ if IsGeneric and IsDelphi then
|
|
OlderIdentifier:=SkipGenericTypes(OlderIdentifier,TypeParamCnt);
|
|
OlderIdentifier:=SkipGenericTypes(OlderIdentifier,TypeParamCnt);
|
|
if OlderIdentifier<>nil then
|
|
if OlderIdentifier<>nil then
|
|
begin
|
|
begin
|