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

substitution in try-catch expression #9704

Closed
yuyichao opened this issue Jan 10, 2015 · 3 comments
Closed

substitution in try-catch expression #9704

yuyichao opened this issue Jan 10, 2015 · 3 comments
Labels
kind:bug Indicates an unexpected problem or unintended behavior

Comments

@yuyichao
Copy link
Contributor

Using substitution in try-catch expression does not produce expected result

julia> a = :a
:a

julia> ex = :(try
       catch $a
       end)
:(try 
    catch 
        a
    end)

julia> ex = :(try
       catch a
       end)
:(try 
    catch a
    end)

Notice in the first case a is in the catch block while in the second case a is the variable to store the exception.

@yuyichao
Copy link
Contributor Author

Other new line sensitive structure like let doesn't have this issue though.

julia> a = :a
:a

julia> ex = :(let $a = 1
       end)
:(let a = 1
    end)

julia> ex = :(let
       $a = 1
       end)
:(let  # line 2:
        a = 1
    end)

@vtjnash vtjnash added the kind:bug Indicates an unexpected problem or unintended behavior label Jan 11, 2015
@JeffBezanson
Copy link
Sponsor Member

Thanks. You're good at finding bugs!

@yuyichao
Copy link
Contributor Author

yuyichao commented Feb 3, 2015

... I felt like bugs are good at finding me though = = .....

Thanks for the fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants