Artifacts Associated With Ticket 36e5517a6850
Ticket change [efd9aa32c2] (rid 225509) by apnadkarni on 2024-05-03 06:50:25:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
In 8.6 ``` % oo::class create C {method Private {} {}; method public {} {}} ::C % info class methods ::C public % info class methods ::C -private public Private ``` The above works as documented as the `-private` option will return private methods **in addition to** public methods as stated in the manpage *If the -private flag is given, the list of methods will also include the private...* (note the "also"). In Tcl 9, this is not the case ``` % oo::class create C {method Private {} {}; method public {} {}} ::C % info class methods ::C public % info class methods ::C -private Private ``` Note the `-private` option now returns only private methods. However, the documentation still seems to match 8.6 behavior: *If the -private flag is given, and the -scope flag is not given, the list of methods will also include the non-exported methods of the class* I'm not sure if the Tcl 9 implementation needs to be fixed or the documentation. If the latter, an Tcl 8 incompatibility note would be desirable. - foundin initialized to: "9.0b2"
- is_private initialized to: "0"
- login: "apnadkarni"
- priority initialized to: "5 Medium"
- private_contact initialized to: "9546e9877f1a8899e25a89082561ee694e7fb402"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "apnadkarni"
- subsystem initialized to: "35. TclOO Package"
- title initialized to:
Incompatible change in behavior of -private option to info class methods command
- type initialized to: "Bug"
Ticket change [522a4fdef3] (rid 225510) by apnadkarni on 2024-05-03 07:09:27:
- assignee changed to: "dkf"
- login: "apnadkarni"
- mimetype: "text/plain"
Ticket change [0461952a8f] (rid 225511) by oehhar on 2024-05-03 07:18:43:
- icomment:
Great catch! I hope, Donal will comment. Some tests here would be great too... Thanks, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [723390302a] (rid 226048) by dkf on 2024-05-15 18:42:03:
- icomment: "I don't recall specifically changing this."
- login: "dkf"
- mimetype: "text/x-markdown"
Ticket change [557f639746] (rid 226049) by dkf on 2024-05-15 18:49:47:
- icomment:
The only likely looking changes would be from [9294775086c983a3](https://core.tcl-lang.org/tcl/info/9294775086c983a3) ([TIP #500](https://core.tcl-lang.org/tips/doc/trunk/tip/500.md)) and *the result of that particular call is supposed to remain identical.* (`info class methods $cls -scope private` would be different...) I really thought I had test cases for all this.
- login: "dkf"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [5e4e46fde0] (rid 226050) by oehhar on 2024-05-16 06:52:20:
- icomment:
Donal, thank you looking into this. So, the answer is, that this change was not intentional and "-private" should list public and private methods. That is an important statement. Perhaps other Wizards may find the cause... Thank you for all, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [38119435e8] (rid 226051) by dkf on 2024-05-16 07:52:33:
- icomment:
It should list exactly the methods listed in 8.6. However, the set of possible methods is expanded: ``` oo::class create C { method foo {} {} method Bar {} {} private method gorp {} {} } puts [info class methods C -private] ``` This should list `foo` and `Bar` (in some order) but *not* `gorp`; that should only be present if `-scope private` is passed (and then that only fetches `gorp`; `-scope` doesn't work the same way). The problem likely lies between: * `InfoClassMethodsCmd` (and probably also `InfoObjectMethodsCmd`) in tclOOInfo.c, * `TclOOGetSortedMethodList` and `TclOOGetSortedClassMethodList` in tclOOCall.c, and * the testing of `info class methods` (and probably `info object methods`) in oo.test (around `oo-17.*` would have been the right place) I'm particularly irritated that there isn't a test of this case. - login: "dkf"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [cbaf70c7f9] (rid 226052) by dkf on 2024-05-16 07:58:05:
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "8"
- severity changed to: "Important"
Ticket change [fd6e5fe322] (rid 226059) by dkf on 2024-05-16 08:45:40:
- icomment:
`tclOOCall.c` is uninvolved; that's only ever used when the `-all` option is passed.
- login: "dkf"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [a803dfaa92] (rid 226062) by dkf on 2024-05-16 08:53:33:
- icomment:
Will be fixed by [bug-36e5517a6850](/tcl/timeline?r=bug-36e5517a6850).
- login: "dkf"
- mimetype: "text/x-markdown"
- icomment:
Ticket change [738006777a] (rid 226063) by dkf on 2024-05-16 08:53:49:
- closedate changed to: "2460446.87070722"
- closer changed to: "dkf"
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"