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 distinction between function definition and function call in lookup_env #395

Open
ghallak opened this issue Jun 25, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@ghallak
Copy link
Contributor

ghallak commented Jun 25, 2022

contract interface NameClashInterface =
  entrypoint double_proto : () => int
  entrypoint double_proto : () => int

contract C = entrypoint init() = ()

The above code will unexpectedly result in the following error:

{error,[{err,{pos,no_file,0,0},
             type_error,
             "Invalid call to contract entrypoint `NameClashInterface.double_proto`.",
             "It must be called as `c.double_proto` for some `c : NameClashInterface`."},

This happens because the lookup in the function lookup_env1 does not distinguish between a call to a qualified function and a new definition of a function in the scope, and it considers both as a call to a qualified function.

@ghallak ghallak added the bug Something isn't working label Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant