Skip to content

Conversation

@aljazerzen
Copy link
Contributor

No description provided.

@aljazerzen aljazerzen force-pushed the function-overloading branch from 13fc74d to 49da8ce Compare January 23, 2024 17:08

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.

2 participants