Distinguishability checking for nullable unions is not correct

Consider these two types:

   (Document or long?)
   (HTMLDivElement or HTMLInputElement)?

Consider applying the rules of 
http://dev.w3.org/2006/webapi/WebIDL/#dfn-distinguishable to them.  The 
two types are not both nullable, so we actually try the three conditions:

1)  Does not apply, since union types are not in the table.
2)  Does not apply, since both types are union or nullable union types.
3)  Applies, since 'Document' is distinguishable from 'HTMLDivElement'
     and 'HTMLInputElement', and so is 'long?'.

I believe this last is a bug, since passing null obviously runs into 
problems here.  I believe the simplest way to fix is to say that the "at 
most one of the two is a nullable type" check should also check for 
nullable member types of unions.  Or something.

-Boris

Received on Monday, 18 June 2012 17:06:46 UTC