Closed
Description
Issue #638 was a pain to find because the root cause is an unimplemented abstract method which silently returns None
and somewhere down the line causes type checking to fail. It would be better to check this explicitly. The following shows that this is done for one of the abstract methods:
https://github.com/JukkaL/mypy/blob/bbb2dd4f07f995a4b28b8044fa91aa97960fe192/mypy/types.py#L532. There are two potential solutions: 1) use abc's @AbstractMethod decorator, 2) raise an error directly in TypeVisitor.
- Ensures that future implementations and changes catch subclasses which do not implement the abstract methods, but requires adding implementations for all of the abstract methods to existing subclasses which are missing them. As there are a few, it would probably be simplest to raise an error there instead of providing the complete implementation, which raises the question: why not just use 2) straight off the bat?
@JukkaL Do you have a preferred solution?