Kind of shy on details up there, but it looks like it's doing exactly what you told it to.
The expression Units new
returned a new Units
instance and then you sent fromString:
to that. Which you've implemented to return the result of sending subclassResponsibility
.
If Units
were truly an abstract class, I wouldn't have expected you to instantiate it (you don't generally send new
to abstract classes, unless you're also messing with the behavior of new
).
So I would have expected you to do something like:
unit := (YourRealSubclass new fromString: aString)
And that YourRealSubclass
has a real implementation of fromString: