News for hackers. Stuff that matters.
Re:Why Checked Exceptions Failed by ajanuary on Saturday July 15, 2023 @05:40PM (#36741207)
someMethod() could return an implementation of Employee that overloads the fire method to dispatch missiles.

The point being, someMethod is doing some job that you want it to do. It is incredibly unlikely to simultaneously start doing a completely different job, while also returning something of the same shape.

Re:Why Checked Exceptions Failed by breadwinner on Saturday July 15, 2023 @06:01PM (#36741339)
> an implementation of Employee that overloads the fire method to dispatch missiles

If you intentionally break it, that's on you.

> It is incredibly unlikely to simultaneously start doing a completely different job, while also returning something of the same shape.

But it doesn't need to return something of the same shape! The shape is not being checked. All the compiler checks is for the existence of a single method of the same name. You call that type checking?

Re:Why Checked Exceptions Failed by nemetroid on Saturday July 15, 2023 @07:32PM (#36741906)
> > an implementation of Employee that overloads the fire method to dispatch missiles

> If you intentionally break it, that's on you.

The shape is not being checked. All the compiler checks is for the existence of a single class of the same name. You call that type checking?