[chuck-users] Bad return signature in pre-constructor leads to null instance

Kassen signal.automatique at gmail.com
Thu Mar 12 16:19:53 EDT 2009


But that misses the point: it is NOT reasonable behavior for a null return
> value for a pre-constructor to cause the constructor itself to return null
> (unless that's documented behavior?!?).  Consider this:

I completely agree. I don't think anybody would argue the current behaviour
is right; it's quite wrong and as you demonstrated it can have follow up
effects that lead to hard to trace issues.

the question I was attempting to address is "what should happen instead?".
In the past some people have suggested that this situation (non-returning
functions) should be made impossible (at the parser stage) and I don't think
we can do that without demanding a very strict style of programmers.

I admit it was unclear that I was partially addressing that suggestion
instead of the bug you reported and that this was unclear. As far as I can
see there is nothing here on which we disagree.

I would, BTW, like to suggest that "fans of kassen" should have plenty of
member functions that return stuff, cups of coffee and dark beers would be
especially good :¬).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090312/c944f61a/attachment.html>

More information about the chuck-users mailing list