This question seems to be relevant to this post.
I noticed that the supplied compiler makes sure that if I have:
do obj.func(...);
if checks that func exists as a member of obj's type. But the reading from chapter 11 seems to say that we don't need to do this kind of checking with our compiler.
sect 11.3.3 wrote
When compiling error-free Jack code, any identifier not found in the symbol table may be assumed to be a
subroutine name or a class name. Since the Jack language syntax rules suffice for distinguishing between
these two possibilities, and since no “linking” needs to be done by the compiler, there is no need to keep
these identifiers in the symbol table.
Don't we need to keep the names of object functions/methods somewhere to check that they exist when we want to call the from outside the class where they are defined later?
Am I right in thinking the book doesn't intend for us to check that methods being called on objects actually exist? If that's the case, any reason why we shouldn't be doing this?
Thanks