Bug 163791

Summary: [Web IDL] Two types are distinguishable for overload resolution if at most one of the two includes a nullable type
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: BindingsAssignee: Chris Dumez <cdumez>
Severity: Normal CC: cdumez, commit-queue, darin, esprehn+autocc, kondapallykalyan, sam
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 163773, 163792, 163793, 163795, 163856, 163859    
Bug Blocks:    
Description Flags
Patch none

Description Chris Dumez 2016-10-21 09:45:46 PDT
Fix bad operation overloads in our IDL files.

As per Web IDL [1], two types are distinguishable if at most one of the two includes a nullable type. However, we have overloads in WebKit with more than one nullable type as distinguishing parameter.
We need to fix this so that the bindings generator can generate more correct code.

See following comment in AreTypesDistinguishableForOverloadResolution() in the bindings generator:
# FIXME: The WebIDL mandates this but this currently does not work because some of our IDL is wrong.
# return 0 if $idlTypeA->isNullable && $idlTypeB->isNullable;

[1] https://heycam.github.io/webidl/#dfn-distinguishable
Comment 1 Chris Dumez 2016-10-21 10:40:31 PDT
Created attachment 292370 [details]
Comment 2 Chris Dumez 2016-10-22 21:10:19 PDT
Created attachment 292532 [details]
Comment 3 WebKit Commit Bot 2016-10-22 22:09:06 PDT
Comment on attachment 292532 [details]

Clearing flags on attachment: 292532

Committed r207725: <http://trac.webkit.org/changeset/207725>
Comment 4 WebKit Commit Bot 2016-10-22 22:09:11 PDT
All reviewed patches have been landed.  Closing bug.