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

Nullables test error on 1.1.0 branch #30344

Closed
KristofferC opened this issue Dec 11, 2018 · 3 comments · Fixed by #30350
Closed

Nullables test error on 1.1.0 branch #30344

KristofferC opened this issue Dec 11, 2018 · 3 comments · Fixed by #30350
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior priority This should be addressed urgently
Milestone

Comments

@KristofferC
Copy link
Member

KristofferC commented Dec 11, 2018

Repro is:

julia> using Nullables

julia> isequal(Nullable{Bool}(), Nullable(Int8(0)))
ERROR: zext_int: value is not a primitive type
Stacktrace: [1] toInt8 at ./boot.jl:627 [inlined]
 [2] Type at ./boot.jl:730 [inlined]
 [3] convert at ./number.jl:7 [inlined]
 [4] _promote at ./promotion.jl:261 [inlined]
 [5] promote at ./promotion.jl:284 [inlined]
 [6] == at ./promotion.jl:350 [inlined]
 [7] isequal at ./operators.jl:123 [inlined]
 [8] isequal(::Nullable{Bool}, ::Nullable{Int8}) at /Users/kristoffer/.julia/dev/Nullables/src/nullable.jl:244
 [9] top-level scope at none:0
@KristofferC KristofferC added this to the 1.1 milestone Dec 11, 2018
@KristofferC
Copy link
Member Author

Removing using Compat from Nullables make the error go away.

@KristofferC
Copy link
Member Author

KristofferC commented Dec 11, 2018

"MWE" :

using Compat

struct Nullable{T}
    hasvalue::Bool
    value::T
    Nullable{T}() where {T} = new(false)
    Nullable{T}(value::T, hasvalue::Bool=true) where {T} = new(hasvalue, value)
end

@inline function Base.isequal(x::Nullable{S}, y::Nullable{T}) where {S,T}
    isequal(x.value, y.value)
end

isequal(Nullable{Bool}(), Nullable{Int8}(Int8(0)))

(this seems to just hang in stead).

@KristofferC KristofferC added the bug Indicates an unexpected problem or unintended behavior label Dec 11, 2018
@StefanKarpinski StefanKarpinski added the priority This should be addressed urgently label Dec 11, 2018
@StefanKarpinski
Copy link
Member

Since we don't seem to have a "blocker" tag, I've put "priority" on this—this is causing breakage in released packages, which means this blocks the release of 1.1.

@vtjnash vtjnash self-assigned this Dec 11, 2018
vtjnash added a commit that referenced this issue Dec 11, 2018
We don't have a way to mark that the slot may contain invalid data,
so just eagerly load it so we can sanitize the value immediately
in case it is garbage.

fix #30344
vtjnash added a commit that referenced this issue Dec 12, 2018
We don't have a way to mark that the slot may contain invalid data,
so just eagerly load it so we can sanitize the value immediately
in case it is garbage.

fix #30344
JeffBezanson pushed a commit that referenced this issue Dec 12, 2018
We don't have a way to mark that the slot may contain invalid data,
so just eagerly load it so we can sanitize the value immediately
in case it is garbage.

fix #30344
KristofferC pushed a commit that referenced this issue Dec 12, 2018
We don't have a way to mark that the slot may contain invalid data,
so just eagerly load it so we can sanitize the value immediately
in case it is garbage.

fix #30344

(cherry picked from commit 897df72)
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 priority This should be addressed urgently
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants