> On May 9, 2017, at 11:06 AM, Michael Catanzaro <mcatanz...@igalia.com> wrote:
> 
> https://bugs.webkit.org/show_bug.cgi?id=171851 
> <https://bugs.webkit.org/show_bug.cgi?id=171851> suggests this approach:
> 
>       static WKAutoplayEvent toWKAutoplayEvent(WebCore::AutoplayEvent event)
>       {
>           switch (event) {
>               // ...
>           }
> 
>           ASSERT_NOT_REACHED();
>           return 0;
>       }
> 
> That works for the cases in that bug, but it won't work in this case, because 
> the return value here is an enum, so a cast would be needed.

You wouldn’t need a cast if you returned one of the enumeration values (say, 
the first one) instead of 0.

I prefer this option for the reason Maciej gave.

Andy
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev

Reply via email to