Question
Cfinterface returntype limitation
It seems that the returntype validation in cfinterface and
implementing classes is a bit too limiting....I can't see how a CFC
function could ever return an instance of itself.
For example, let's say I have an IOrder interface with an init() function where the returntype="IOrder". Then I create an Order.cfc that implements IOrder and add my init() function with returntype="Order". CF blows up at object creation and says the return types do not match. I think this is mistaken, since the Order returntype is in fact an instance of IOrder.
Is there something I'm missing? I know I can use "any" in both functions as a workaround, but that undermines the whole point of using strict interfaces in the first place.
For example, let's say I have an IOrder interface with an init() function where the returntype="IOrder". Then I create an Order.cfc that implements IOrder and add my init() function with returntype="Order". CF blows up at object creation and says the return types do not match. I think this is mistaken, since the Order returntype is in fact an instance of IOrder.
Is there something I'm missing? I know I can use "any" in both functions as a workaround, but that undermines the whole point of using strict interfaces in the first place.
