View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033584 | FPC | Compiler | public | 2018-04-08 08:36 | 2021-01-04 17:25 |
Reporter | codz | Assigned To | Florian | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
Platform | windows | ||||
Product Version | 3.0.4 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0033584: invalid warning | ||||
Description | the compiler said : 'test.pas(6,4) Note: Private field "tObj$1.name" is never used' and thats wrong ! , but this warning appears only if 'name' field is private , when i turn it to public it compiles without warnings | ||||
Steps To Reproduce | program test; type generic tObj<T> = class private name : string; end; var ps : specialize tObj<int32>; begin ps.name := 'Object'; readln; end. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
FPCOldBugId | |||||
FPCTarget | - | ||||
Attached Files |
|
|
And that is correct: a private field is hidden to the implementation inside a class. You are using it as a public field. The compiler told you so... Not a bug. Belongs on the support forums. |
|
Of course, this is a bug. The private field is hidden for implementation inside a UNIT, used in a UNIT, but the compiler erroneously reports that the field is never used. |
|
Yes, it is a bug. |
|
Fixed in trunk though I cannot find the relevant revision. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-04-08 08:36 | codz | New Issue | |
2018-04-08 12:06 | Thaddy de Koning | Note Added: 0107688 | |
2018-04-08 12:34 | Serge Anvarov | Note Added: 0107690 | |
2018-04-08 13:00 | Jonas Maebe | Note Added: 0107692 | |
2021-01-04 17:25 | Florian | Assigned To | => Florian |
2021-01-04 17:25 | Florian | Status | new => resolved |
2021-01-04 17:25 | Florian | Resolution | open => no change required |
2021-01-04 17:25 | Florian | Fixed in Version | => 3.3.1 |
2021-01-04 17:25 | Florian | FPCTarget | => - |
2021-01-04 17:25 | Florian | Note Added: 0128078 |