Prophet1024 wrote:This method should always return an integer, not the selector.
No. That is a private
method whose result is only
used as an argument to the CompiledMethod>>#sendsSpecialSelector:
method which expects a method selector (a Symbol).
At some point in the distant past, the CompiledMethod>>#sendsSpecialSelector:
method lilely expected an integer to be passed in, but was then changed to expect a selector. The implementation of its precursor method, Behavior>>specialSelectorIndexFor:
, was then changed to reflect those new requirements without changing its name. At this point, it can't be changed as its current implementation has been in place and expected for more than ten years.
In any case, it is a private method that should not be used for anything other than its intended (and very narrow) purpose.