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

Function identifiers are allowed to be shadowed in their bodies #307

Open
anton-trunov opened this issue Apr 27, 2024 · 2 comments · May be fixed by #323
Open

Function identifiers are allowed to be shadowed in their bodies #307

anton-trunov opened this issue Apr 27, 2024 · 2 comments · May be fixed by #323
Assignees
Labels
bug Something isn't working scope: var-scope Scoping rules for identifiers typechecker
Milestone

Comments

@anton-trunov
Copy link
Member

Both of the snippets below compile just fine, but should not, since variable shadowing is not allowed and functions in Tact are recursive by default:

fun rec(): Int {
    let rec: Int = 42;  // shadowing error
    return rec;
}
fun rec(): Int {
    let rec: Int = 42;  // shadowing error
    return rec();
}
@anton-trunov anton-trunov added bug Something isn't working scope: var-scope Scoping rules for identifiers typechecker labels Apr 27, 2024
@anton-trunov anton-trunov added this to the v1.4.0 milestone May 1, 2024
@vitorpy vitorpy linked a pull request May 3, 2024 that will close this issue
4 tasks
@anton-trunov anton-trunov modified the milestones: v1.4.0, v1.3.1 May 17, 2024
@Gusarich
Copy link
Member

@vitorpy since you've already opened a PR, can you leave a comment here so that I can assign you to this issue?

@vitorpy
Copy link
Contributor

vitorpy commented May 17, 2024

Sure thing - I'll see if I can find some time next week to get back to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scope: var-scope Scoping rules for identifiers typechecker
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants