Re: [heycam/webidl] Add bigint type (#525)

> What does calling someX.foo("1") do?

The way the PR is written right now, it would call the `unsigned long long` overload, if you meant to name both your operations the same.  If you really did mean different names, then it would convert the string to bigint and call the one thing named "foo".

> What should it do?

Good question.  ;)

Here's a worse case:

    interface X {
      void foo(bigint x);
      void bar(bigint x);
      void bar(Node x);
    }

Here `foo("1")` would convert `"1"` to bigint, but `bar("1")` would throw, given the bits in the PR at the moment, because there is no case in https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm step 12 that supports a declared type of bigint with an arg that does not have `Type(arg) == BigInt`.  So the exact changes we want to the overload resolution algorithm here require some thought.  Adding a new overload should generally not cause previously-valid calls to throw.

Also, we need corresponding changes to <https://heycam.github.io/webidl/#es-to-union>; those aren't in the PR afaict.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/525#issuecomment-367759335

Received on Thursday, 22 February 2018 17:36:20 UTC