[bug] WeakArray new error

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

[bug] WeakArray new error

Luca Bruno aka Lethalman
Issue status update for
http://smalltalk.gnu.org/node/243
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/243

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  lethalman
 Updated by:   lethalman
 Status:       active

Hello,
I've been trying to use WeakArrays. This is the error when I issue
WeakArray new:

Object: nil error: did not understand #do:
MessageNotUnderstood(Exception)>>signal
UndefinedObject(Object)>>doesNotUnderstand: #do:
WeakArray>>do:
WeakArray(Array)>>printOn:
WeakArray(Object)>>printString
WeakArray(Object)>>printNl

Doesn't happen with WeakArray new: size.




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: [bug] WeakArray new error

Paolo Bonzini-3
Issue status update for
http://smalltalk.gnu.org/project/issue/243
Post a follow up:
http://smalltalk.gnu.org/project/comments/add/243

 Project:      GNU Smalltalk
 Version:      <none>
 Component:    Base classes
 Category:     bug reports
 Priority:     normal
 Assigned to:  Unassigned
 Reported by:  lethalman
 Updated by:   bonzinip
-Status:       active
+Status:       fixed

Fixed in c6b3fdf, thanks!

diff --git a/kernel/WeakObjects.st b/kernel/WeakObjects.st
index 8b4127f..60fd905 100644
--- a/kernel/WeakObjects.st
+++ b/kernel/WeakObjects.st
@@ -39,9 +39,15 @@ Array subclass: WeakArray [
 I am similar to a plain array, but my items are stored in a weak
object,
 so I track which of them are garbage collected.'>
 
+    WeakArray class >> new [
+       "Create a new WeakArray of size 0."
+
+      
+       ^self new: 0
+    ]
+
     WeakArray class >> new: size [
-       "Private - Initialize the values array; plus, make it weak and
create
-        the ByteArray used to track garbage collected values"
+       "Create a new WeakArray of the given size."
 
       
        ^self basicNew initialize: size





_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk