Manuscript (Case [Issue]22255) Collection - Either Pragma should compare methodSelector or PragmaCollector should account for bad comparison

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Manuscript (Case [Issue]22255) Collection - Either Pragma should compare methodSelector or PragmaCollector should account for bad comparison

Pharo Issue Tracker
Manuscript Notification
avatar
Bug in Project:  Collection: 1. Pharo Image  •  You are subscribed to this case
Part of Pragma comparison (Pragma>>#=) compares its containing method, however CompiledMethods do not compare selector.

Therefore PragmaCollector can sometimes add duplicate entries or remove incorrect ones when a different method was removed.

Comparison failure example:
<code>
cls := Object subclass: #Something.

cls compile: 'first
<broken>
^ 1'.

cls compile: 'second
<broken>
^ 1'.

pragmas := Pragma allNamed: #broken in: cls.
pragmas. "an Array(<broken> <broken>)"
pragmas asSet. "a Set(<broken>)"

cls methods. "{Something>>#first. Something>>#second}"
cls methods asSet. "a Set(Something>>#first)"

(cls>>#first) = (cls>>#second) "true"
</code>

PragmaCollector failure example:
<code>
cls := Object subclass: #Something.

cls compile: 'first
<broken>
^ 1'.

cls compile: 'second
<broken>
^ 1'.

collector := PragmaCollector filter: [ :prg | (#(broken) includes: prg keyword) ].
collector reset.
collector collected collect: #methodSelector. "an OrderedCollection(#first #second)"

cls removeSelector: #second.
collector collected collect: #methodSelector. "an OrderedCollection(#second)"
</code>
Priority Priority: 3 – Must Fix Status Status: Work Needed
Assigned To Assigned to: Everyone Milestone Milestone: Pharo7.0

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want Manuscript notifications anymore? Update your preferences.

Manuscript

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
https://lists.gforge.inria.fr/mailman/listinfo/pharo-bugtracker