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

fatal error in type inference (type bound) #23356

Closed
simonster opened this issue Aug 19, 2017 · 2 comments
Closed

fatal error in type inference (type bound) #23356

simonster opened this issue Aug 19, 2017 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version

Comments

@simonster
Copy link
Member

struct BitsUnion
    x::Union{Int64,Float64}
end
bitsunion = BitsUnion(5.0);
f(x) = nothing
g(x) = f(convert(Union{Float64, Int64}, getfield(x, 1)))

julia> g(bitsunion)
ERROR: fatal error in type inference (type bound)
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] g(::BitsUnion) at ./REPL[4]:1

Only happens on master.

@simonster simonster added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Aug 19, 2017
@quinnj
Copy link
Member

quinnj commented Aug 19, 2017

Probably also a dup of #23351 since type inference can't load what the type of bitsunion.x is.

@simonster
Copy link
Member Author

You're probably right that it's the same issue. It seems like "fatal error in type inference (type bound)" is actually a runtime error that type inferences writes into the generated code and it gets triggers when the getfield call doesn't return a Float64 or Int64.

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 regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

2 participants