Earlier quoted context omitted.
> The abstract class defines which methods every class that inherits from it must define by using abstract methods. In their example, the type checker can infer that Animal has a `talk` method, even if it's never explicitly defined: abstract class Animal # no talk method here! end class Dog In their own words, “Now the code compiles:” john.pet.talk #=> "Woof!" Now, what happens if, in a separate module , I define a S…
It will simply stop compiling the code and it will say "undefined method 'talk' for Snake". You will get a similar error if `talk` is defined as an abstract method in the base abstract class. So abstract methods are just a standard way to document this and to improve error messages. There's no safety hole here.
(0) If Snake is in the same module as Animal, the error is that “john.pet.talk” is a call to a nonexistent method.
(1) If Snake is in a different module from Animal, the errors is that Snake doesn't have a talk method.
This isn't nice.