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

UndefVarError not caught in if/else statement #596

Open
nantiamak opened this issue Jan 26, 2024 · 0 comments
Open

UndefVarError not caught in if/else statement #596

nantiamak opened this issue Jan 26, 2024 · 0 comments
Labels
error analysis Anything related to the error analysis performed by `JETAnalyzer`

Comments

@nantiamak
Copy link

I ran JET.report_file("UndefVarError_branching_test.jl"; mode=:typo) on the following code:

function foo(a)
    if a == 1
        output_string = "a is 1"
        return output_string
    else
        return "$output_string is not true"
    end
end

foo(2)

Variable output_string is defined only inside if, but JET didn't report an UndefVarError for return "$output_string is not true". Is this expected?

@aviatesk aviatesk added the error analysis Anything related to the error analysis performed by `JETAnalyzer` label Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error analysis Anything related to the error analysis performed by `JETAnalyzer`
Projects
None yet
Development

No branches or pull requests

2 participants