Working on some Smalltalk code I discovered a little bug in VAST 7.5.0:
Inspect this in your Transcript or Workspace and you will be represented by a nice Stackoverflow error
- Code: Select all
'40' >= 40
When looking in the source code which dates from 1996 in the String(EsString) implementation, it says:
- Code: Select all
>= aString
"Answer a Boolean which is true if the receiver collates after
aString or the same as aString and false otherwise. The collation
sequence ignores the case of the Characters.
Fail if aString is not a String."
^aString <= self
But it never fails and passes the operation to the arguments' implementation. At the Smallinteger(Number) implementation the code looks like:
- Code: Select all
<= aNumber
"Answer a Boolean indicating true if the receiver is less
than or equal to the argument, aNumber; otherwise answer
false.
Fail if aNumber is not a type of Number."
^(aNumber < self) not
And thus results in an endless loop. There is no check in either method on the argument's type and none of the implementations throws an Error.
Will this be fixed in VAST 8.0?
Regards, Yuri.