SubscriptOutOfBounds: 0 in blocks evaluating nil

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

SubscriptOutOfBounds: 0 in blocks evaluating nil

Jose San Leandro
Hi,

I'm experiencing an issue when using whileFalse:, in Pharo 4.

I've just looking for opened bugs in pharo.fogbugz.com but I don't see any matching my problem, apparently.

In the following example, I get a SubscriptOutOfBounds: 0.

Object subclass: #WhileFalseIssue
    instanceVariableNames: 'myFlag'
    classVariableNames: ''
    category: 'MyTests'

WhileFalseIssue>>attemptUninitialized
    [ myFlag ] whileFalse: [myFlag := true ].
    ^ myFlag.

WhileFalseIssue>>attemptInitialized
    myFlag := false.
    [ myFlag ] whileFalse: [myFlag := true ].
    ^ myFlag.

Calling attempt like this:

WhileFalseIssue new attemptUninitialized.

launches the debugger with "SubscriptOutOfBounds: 0" (see attached screenshot), whereas

WhileFalseIssue new attemptInitialized.

works fine.

Should I file in a bug in fogbugz? I will try with Pharo 5.

Kind regards,
Jose.

WhileFalseUninitialized_SubscriptOutOfBounds_0.png (101K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: SubscriptOutOfBounds: 0 in blocks evaluating nil

Nicolai Hess
Hi Jose,

2015-07-14 8:59 GMT+02:00 Jose San Leandro <[hidden email]>:
Hi,

I'm experiencing an issue when using whileFalse:, in Pharo 4.

I've just looking for opened bugs in pharo.fogbugz.com but I don't see any matching my problem, apparently.

In the following example, I get a SubscriptOutOfBounds: 0.

Object subclass: #WhileFalseIssue
    instanceVariableNames: 'myFlag'
    classVariableNames: ''
    category: 'MyTests'

WhileFalseIssue>>attemptUninitialized
    [ myFlag ] whileFalse: [myFlag := true ].
    ^ myFlag.

WhileFalseIssue>>attemptInitialized
    myFlag := false.
    [ myFlag ] whileFalse: [myFlag := true ].
    ^ myFlag.

Calling attempt like this:

WhileFalseIssue new attemptUninitialized.

launches the debugger with "SubscriptOutOfBounds: 0" (see attached screenshot), whereas

WhileFalseIssue new attemptInitialized.

works fine.

Should I file in a bug in fogbugz? I will try with Pharo 5.

Yes please. (It fails on pharo 5, too).

 

Kind regards,
Jose.