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

Closure lowering error #18173

Closed
yuyichao opened this issue Aug 22, 2016 · 0 comments
Closed

Closure lowering error #18173

yuyichao opened this issue Aug 22, 2016 · 0 comments
Assignees
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) kind:bug Indicates an unexpected problem or unintended behavior

Comments

@yuyichao
Copy link
Contributor

This is what's causing #18156 (comment) after #18130. I assume @tkelman have already figured out the cause but I don't think there's an open issue for it.

Reduced test case.

function do_test(body)
    try
        body()
    end
end
function f()
    do_test(()->successflag)
    successflag = false
end

f()

Results in an UndefVarError since the closure construction want to access successflag before it is defined.

Lowered IR

begin 
        nothing
        #3 = $(Expr(:new, :((Core.apply_type)(Main.##3#4,(Core.typeof)(successflag))), :(successflag)))
        SSAValue(0) = #3
        (Main.do_test)(SSAValue(0)) # line 11:
        successflag = false
        return false
end
@yuyichao yuyichao added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Aug 22, 2016
tkelman added a commit that referenced this issue Aug 22, 2016
This reverts commit 09f7005.
un-backports #18130 for now until there's a fix for #18173
(was breaking BaseTestDeprecated.jl)
@JeffBezanson JeffBezanson added the kind:bug Indicates an unexpected problem or unintended behavior label Aug 22, 2016
tkelman pushed a commit that referenced this issue Aug 22, 2016
JeffBezanson added a commit that referenced this issue Aug 22, 2016
fix #18173, closure lowering error caused by #18130
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants