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

bug in Conditional inference design #25579

Closed
vtjnash opened this issue Jan 16, 2018 · 0 comments · Fixed by #25602
Closed

bug in Conditional inference design #25579

vtjnash opened this issue Jan 16, 2018 · 0 comments · Fixed by #25602
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:inference Type inference

Comments

@vtjnash
Copy link
Member

vtjnash commented Jan 16, 2018

julia> function f(g)
         h = g[]
         t = (h === nothing)
         h = nothing
         println(t ? typeof(h) : typeof(h))
       end
f (generic function with 1 method)

julia> f(Ref{Union{Int, Nothing}}( nothing ))
Nothing

julia> f(Ref{Union{Int, Nothing}}( 1 ))
Int64

um, yeah, variable reuse: I guess just don't do that.

@vtjnash vtjnash added the compiler:inference Type inference label Jan 16, 2018
@vtjnash vtjnash self-assigned this Jan 16, 2018
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Jan 16, 2018
vtjnash added a commit that referenced this issue Jan 17, 2018
We were neglecting to clear Conditional objects upon assignment to their attached slot
(which invalidates their knowledge of the contents of that slot)

fixes #25579
vtjnash added a commit that referenced this issue Jan 17, 2018
We were neglecting to clear Conditional objects upon assignment to their attached slot
(which invalidates their knowledge of the contents of that slot)

fixes #25579
vtjnash added a commit that referenced this issue Jan 17, 2018
We were neglecting to clear Conditional objects upon assignment to their attached slot
(which invalidates their knowledge of the contents of that slot)

fixes #25579
vtjnash added a commit that referenced this issue Jan 18, 2018
We were neglecting to clear Conditional objects upon assignment to their attached slot
(which invalidates their knowledge of the contents of that slot)

fixes #25579
vtjnash added a commit that referenced this issue Jan 18, 2018
)

We were neglecting to clear Conditional objects upon assignment to their attached slot
(which invalidates their knowledge of the contents of that slot)

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

Successfully merging a pull request may close this issue.

2 participants