Class>>_classDefiningClassVar: will correctly return the receiver when the argument is a class variable defined on the receiver. But if the class variable is defined on one of the receiver's superclasses, this method will return nil instead of the correct superclass.
File in the following code as SystemUser and commit.
category: 'Subclass Creation' method: Class _classDefiningClassVar: aSymbol "Returns the receiver or the superclass that defines a class variable with name aSymbol, otherwise returns nil." | aClass | aClass := self . [ aClass _classVars ifNotNil:[ :cvs | ( cvs associationAt: aSymbol otherwise: nil ) ifNotNil:[ ^ aClass ]. ]. aClass := aClass superClass . aClass == nil ] untilTrue . ^ nil %
Last updated: 10/14/14