The Philosophy of Nothing
Mark Mahieu
markmahieu at googlemail.com
Wed Dec 2 08:32:49 PST 2009
On 2 Dec 2009, at 16:26, Paul Benedict wrote:
> Neal,
>
> On Wed, Dec 2, 2009 at 10:07 AM, Neal Gafter <neal at gafter.com> wrote:
>> On Wed, Dec 2, 2009 at 7:59 AM, Paul Benedict <pbenedict at apache.org> wrote:
>>>
>>> Does the spec prevent defining method that can neither return nor throw?
>>>
>>> public Nothing func() throws Nothing { }
>>
>> No, because Java has unchecked exceptions, and for other reasons that will
>> be more clear when part b (0.6b) is published.
>>
>> I can't imagine what the value would be of adding such restrictions to the
>> specification or compiler.
>
> If a method cannot return nor throw, I would expect this to be an
> obvious compilation error.
Not sure I follow this.
Your method declares that it cannot complete normally (ie. return explicitly or implicitly), but not that it doesn't throw. In fact, I believe you'd need a throw statement in there to get it to compile at all.
Mark
More information about the closures-dev
mailing list