Spec icon indicating copy to clipboard operation
Spec copied to clipboard

SpCollectionListModel now (unhelpfully) uses `identityIndexOf:` instead of `indexOf:`

Open ericwinger opened this issue 1 year ago • 1 comments

Sometime recently a change occurred between stable versions of Pharo 12 ... SpCollectionListModel>>#indexOf:ifAbsent: changed from using indexOf:ifAbsent: to identityIndexOf:ifAbsent:.

I'm not sure prompted the change but it, at best, isn't helpful because a number of my tests broke when string identity equality was suddenly required. Simple selections like below broke because the strings weren't identical.

self variableListPresenter selections: #( 'format' ).

Finding the problem was daunting. It would be helpful if index lookup in collections was reverted to simple equality comparison.

Comparing methods: Pharo 12.0.0 Build information: Pharo-12.0.0+SNAPSHOT.build.1523.sha.3fd20c14be4ec63710f40bb8eb486e1eaf262af2 (64 Bit) image

Pharo 12.0.0 Build information: Pharo-12.0.0+SNAPSHOT.build.1542.sha.bf940cf78c64105fcd27fc961d34c9163e548146 (64 Bit) image

ericwinger avatar Dec 17 '24 20:12 ericwinger

Hi @ericwinger Thank you for the report. I faced the same problem. It has already been fixed in Pharo 13. I proposed a fix for Pharo 12: see https://github.com/pharo-spec/Spec/pull/1681 It is waiting for integration @estebanlm

demarey avatar Dec 17 '24 21:12 demarey