GemTalk / Rowan

a new project/package manager for Smalltalk that supports FileTree and Tonel repositories, and is independent of Monticello and Metacello
MIT License
14 stars 7 forks source link

`SequenceableCollection class>>#new:withAll:` don't work for `OrderedCollection` #903

Open gcotelli opened 1 year ago

gcotelli commented 1 year ago

This method is a Rowan extension and it's not working correctly for OrderedCollection. It works ok for ByteArray and Array, but for OrderedCollection, it returns an empty instance.

Here's a test case showing the problem:

testOrderedCollectionNewWithAll

| collection|
collection := OrderedCollection new: 6 withAll: true.
self
  assert: collection size equals: 6;
  assert: (collection allSatisfy: [:each | each ])
AllenOtis commented 1 year ago

OrderedCollection class needs to reimplement new:withAll: since it reimplements new: in the GemStone base image.