WebGL IDL for uniform1fv is not valid WebIDL

The IDL in question is:

     void uniform1fv(WebGLUniformLocation? location, Float32Array v);
     void uniform1fv(WebGLUniformLocation? location, float[] v);

Unfortunately if you look at the table at 
http://dev.w3.org/2006/webapi/WebIDL/#dfn-distinguishable you see that 
T[] and an interface type (which is what Float32Array is) are only 
distinguishable if the interface type doesn't support indexed 
properties.  Which Float32Array does, of course.  So this IDL fails this 
requirement from the section linked above:

   If there is more than one entry in an effective overload set that has
   a given type list length, then for those entries there MUST be an
   index i such that for each pair of entries the types at index i are
   distinguishable.

Cameron, I'm not sure why exactly interface types with indexed 
properties are not distinguishable from IDL arrays.  For non-callback 
interfaces, it seems like the UA could tell them apart and we could 
define that the interface version is called if the right interface is 
passed in, else the array version is called.

But failing changes to WebIDL, the IDL here would need to change somehow.

-Boris

Received on Monday, 2 April 2012 14:49:02 UTC