W3C home > Mailing lists > Public > public-script-coord@w3.org > April to June 2012

Re: Nullable union types containing other nullable types

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Fri, 13 Apr 2012 23:49:22 -0400
Message-ID: <4F88F3C2.8000200@mit.edu>
To: Cameron McCormack <cam@mcc.id.au>
CC: "public-script-coord@w3.org" <public-script-coord@w3.org>
On 4/13/12 11:43 PM, Cameron McCormack wrote:
 > No, in #idl-nullable-type it says:

Ah, indeed.  Excellent.

Can't wait till we have some automated tests for this in our parser.... ;)

> The only reason we *might* like to allow this is if you had a typedef
> for some type that was nullable:
>
> typedef sequence<long>? Numbers;
> typedef sequence<DOMString>? Letters;
>
> which meant that you couldn't write for example
>
> void f((Numbers or Letters) x);

That's a different situation, actually.  That's two nullable types in a 
single union, which is pretty explicitly disallowed because they're not 
distinguishable.

-Boris
Received on Saturday, 14 April 2012 03:49:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:06 UTC