When doing file out in Change Sorter, classes are sorted by inheritance hierarchy, i.e. super classes first, and then subclasses, but the class initialization statements are written in reversed order, which will cause problem if class variables are involved.
Take Swiki for example, following are definition of SwikiFile and SwikiImage, class variable MimeToClass is initialized in SwikiFile class>>initialize, and SwikiImage class>>initialize relies on that class variable.
Actually, I have checked relevant code (ChangeSet>>fileOutOn:) in Squeak 3, Squeak 2 and even Squeak 1, it seems that code logic has been like this for a long time.
So I'm not really sure, is this a bug, or is there something wrong with my understanding?
P.S. Source code of Swiki downloaded from https://wiki.squeak.org/swiki/15 has correct order, not sure if it is tweaked manually after filing out.
When doing file out in Change Sorter, classes are sorted by inheritance hierarchy, i.e. super classes first, and then subclasses, but the class initialization statements are written in reversed order, which will cause problem if class variables are involved.
Take Swiki for example, following are definition of
SwikiFile
andSwikiImage
, class variableMimeToClass
is initialized inSwikiFile class>>initialize
, andSwikiImage class>>initialize
relies on that class variable.Currently in Squeak 6.0, following is the initialization order in file out result of Swiki code, which I think is incorrect:
Actually, I have checked relevant code (
ChangeSet>>fileOutOn:
) in Squeak 3, Squeak 2 and even Squeak 1, it seems that code logic has been like this for a long time.So I'm not really sure, is this a bug, or is there something wrong with my understanding?
P.S. Source code of Swiki downloaded from https://wiki.squeak.org/swiki/15 has correct order, not sure if it is tweaked manually after filing out.