@kevlin The citation is to the Liskov paper that everybody cites, which I believe is the first one that talks about hierarchy and inheritance:
Liskov, Barbara. Data Abstraction and Hierarchy. ACM SIGPLAN Notices V23N5, October 1987, Addendum to the OOPSLA 1987 Proceedings. https://dl.acm.org/doi/10.1145/62139.62141
For convenience, the oft-quoted section that introduces the notion of substitution is the first paragraph of 3.3, “Type Hierarchy”: (1/6)
«In this case, operations that not all real devices can do must be specified in a general way that allows exceptions to be signalled. For example, ‘get_char’ would signal an exception when called on a printer.»
A printer throwing an exception in response to ‘get_char’ is similar to a Java unmodifiable collection throwing an exception in response to a mutation method. (6/6)
@kevlin
@stuartmarks Ah, OK, I was familiar with this section and conclusion, but I realise now I misread your original post.
I had assumed that you were saying exceptions were unconditionally OK, whereas I now see you carefully stated — and I overlooked — "... when permitted by specification", which naturally leads to covariant exception substitution.
In which case, yes, we are definitely agreed on this interpretation! Thanks for taking the time.