On Wed, Jun 26, 2013 at 4:48 PM, Johannes Schlüter
<johan...@schlueters.de>wrote:

> On Wed, 2013-06-26 at 16:40 +0200, Ferenc Kovacs wrote:
>
> > >
> > I think that the return typehints a bit easier topic than the input type
> > hinting(for scalars), because that affects the caller, while return type
> > hinting is more contained: you write the function, you put the return
> > typehint there, if the method tries to return something else, then your
> > code is at fault.
> > So even if we would allow return typehints for scalars that would only
> > affects those functions where the developer opts-in.
>
> So a function author doesn't trust himself and therefore we change the
> language syntax?
>
> johannes
>
>
or not trusting the subsystem that he/she calls, and he/she wants to make a
hard promise about the return value.
I could also mention, that this feature could be used in static analysis
and IDEs(albeit most IDEs out there already supports docblocks).
I'm not saying that this feature is a must, I just wanted to emphasize that
it is a little bit less touchy subject than the (scalar) input typehints.

-- 
Ferenc Kovács
@Tyr43l - http://tyrael.hu

Reply via email to