Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: 1026 function overloading #86

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

aljazerzen
Copy link
Contributor

No description provided.


Note that in user-defined functions, it is not allowed to use
pseudo-types or overload functions that take object types. Overloading
of functions that take scalar types does not work correctly. This means
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what happens with scalars currently:

      create scalar type A extending str;
      create scalar type B extending A;
   
      create function foo(a: str) -> str using ("matched str");
      create function foo(a: A) -> str using ("matched A");
   
      select foo(<str>"hello"); # error: please disambiguate between the two function
                                # I would say this is incorrect, it should "match str"

      select foo(<A>"hello");   # matched A
                                # correct

      select foo(<B>"hello");   # internal server error: function edgedbpub."..." is not unique
                                # obviously bad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant