Hi,
just to add my 0.02$
AFAICS there are two ways at looking at things.
#1 Gunnar's strictly OO approach. Any sub-type can be used where its super-types can
be used. This principle is
violated if parameter constraints could be added to sub-types, putting more constraints in
place to be obeyed by the caller.
For a caller it must be clear which constraints exist when calling a method. For this
reason constraints need to be
defined on the interface and implementation could not add constraints.
#2 Paul's suggestion is saying the runtime type is the determining factor. When an
implementation of an interface method
is called evaluate the constraints on the implementation. This could be useful in case
different implementation really have
different constraints/preconditions.
I can see use cases for both options and feel undecided. Maybe this could be handled via
an option?
--Hardy