mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 20:49:09 +02:00
* also give a warning when a field masks an identifier from a category
* also give a warning when a field/parameter/local variable masks an identifier from a class helper that's in scope git-svn-id: trunk@29498 -
This commit is contained in:
parent
990e47f2d3
commit
8fe981cccb
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11760,6 +11760,7 @@ tests/test/thlp44.pp svneol=native#text/pascal
|
|||||||
tests/test/thlp45.pp svneol=native#text/pascal
|
tests/test/thlp45.pp svneol=native#text/pascal
|
||||||
tests/test/thlp46.pp svneol=native#text/pascal
|
tests/test/thlp46.pp svneol=native#text/pascal
|
||||||
tests/test/thlp47.pp svneol=native#text/pascal
|
tests/test/thlp47.pp svneol=native#text/pascal
|
||||||
|
tests/test/thlp48.pp svneol=native#text/plain
|
||||||
tests/test/thlp5.pp svneol=native#text/pascal
|
tests/test/thlp5.pp svneol=native#text/pascal
|
||||||
tests/test/thlp6.pp svneol=native#text/pascal
|
tests/test/thlp6.pp svneol=native#text/pascal
|
||||||
tests/test/thlp7.pp svneol=native#text/pascal
|
tests/test/thlp7.pp svneol=native#text/pascal
|
||||||
|
@ -1498,8 +1498,9 @@ implementation
|
|||||||
happen due to all possible categories being imported via
|
happen due to all possible categories being imported via
|
||||||
CocoaAll }
|
CocoaAll }
|
||||||
warn:=
|
warn:=
|
||||||
is_objccategory(tdef(hsym.owner.defowner)) and
|
(is_objccategory(tdef(hsym.owner.defowner)) or
|
||||||
(sym.typ in [paravarsym,localvarsym]);
|
is_classhelper(tdef(hsym.owner.defowner))) and
|
||||||
|
(sym.typ in [paravarsym,localvarsym,fieldvarsym]);
|
||||||
DuplicateSym(hashedid,sym,hsym,warn);
|
DuplicateSym(hashedid,sym,hsym,warn);
|
||||||
result:=true;
|
result:=true;
|
||||||
end;
|
end;
|
||||||
|
24
tests/test/thlp48.pp
Normal file
24
tests/test/thlp48.pp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{ %fail }
|
||||||
|
{ %opt=-vw -Sew }
|
||||||
|
|
||||||
|
program thelper;
|
||||||
|
|
||||||
|
{$mode objfpc}
|
||||||
|
|
||||||
|
type
|
||||||
|
TTest = class;
|
||||||
|
|
||||||
|
TTestHelper = class helper for TTest
|
||||||
|
procedure Test;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TTest = class
|
||||||
|
Test: LongInt;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TTestHelper.Test;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user