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

inlining bug with concrete Union constraints #39218

Closed
vtjnash opened this issue Jan 12, 2021 · 1 comment · Fixed by #39237
Closed

inlining bug with concrete Union constraints #39218

vtjnash opened this issue Jan 12, 2021 · 1 comment · Fixed by #39237
Assignees
Labels
regression Regression in behavior compared to a previous version types and dispatch Types, subtyping and method dispatch

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented Jan 12, 2021

julia> struct A end

julia> struct B end

julia> const AB = Union{A, B}
AB (alias for Union{A, B})

julia> f(::T, ::T) where {T<:AB} = false
f (generic function with 1 method)

julia> g(a, b) = (@nospecialize; if a isa AB && b isa AB; f(a, b); end;)
g (generic function with 1 method)

julia> g(A(), A())
false

julia> g(A(), B())
ERROR: fatal error in type inference (type bound)
Stacktrace:
 [1] g(a::Any, b::Any)
   @ Main ./REPL[15]:1
 [2] top-level scope
   @ REPL[17]:1

julia> versioninfo()
Julia Version 1.7.0-DEV.184
Commit 8e0183f2b6 (2020-12-28 17:36 UTC)
@vtjnash vtjnash added the backport 1.6 Change should be backported to release-1.6 label Jan 12, 2021
@vtjnash vtjnash self-assigned this Jan 12, 2021
@vtjnash vtjnash added types and dispatch Types, subtyping and method dispatch regression Regression in behavior compared to a previous version labels Jan 12, 2021
@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Jan 12, 2021

MWE:

julia> Tuple{Union{A,B}, Union{A,B}} == Union{Tuple{A,A}, Tuple{B,B}}
true

Yikes! This was broken sometime during v1.3-dev.

@vtjnash vtjnash removed their assignment Jan 12, 2021
@JeffBezanson JeffBezanson self-assigned this Jan 13, 2021
@KristofferC KristofferC mentioned this issue Jan 19, 2021
60 tasks
KristofferC pushed a commit that referenced this issue Jan 19, 2021
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Feb 1, 2021
KristofferC pushed a commit that referenced this issue Feb 1, 2021
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this issue May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this issue May 9, 2021
staticfloat pushed a commit that referenced this issue Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression Regression in behavior compared to a previous version types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants