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

"No function overload function" when user-defined scalar used as function parameter #893

Open
hbriese opened this issue Mar 7, 2024 · 1 comment

Comments

@hbriese
Copy link

hbriese commented Mar 7, 2024

Code
The code causing the error.

e.greet(e.cast(e.Name, 'greg'));

Schema

module default {
  scalar type Name extending str {}

  function greet(name: Name) -> str using (
    "Hello, " ++ name ++ "!"
  );
}

Generated EdgeQL

Exception thrown

Error or desired behavior

No function overload found for 'e.default.greet()' with args: Element: default::Name (One)

Versions (please complete the following information):

  • OS:
  • EdgeDB version (e.g. 2.0): 4.5+28216a1"
  • EdgeDB CLI version (e.g. 2.0): 4.1.0+03ae624
  • edgedb-js version (e.g. 0.20.10;): 1.4.1
  • @edgedb/generate version (e.g. 0.0.7;): 0.4.1
  • TypeScript version: 5.3.3
  • Node/Deno version: 20.9.0
@hbriese
Copy link
Author

hbriese commented Mar 7, 2024

The workaround is to accept a primative as the type param e.g. str and cast it to the desired type in the function

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

No branches or pull requests

1 participant