-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviortypes and dispatchTypes, subtyping and method dispatchTypes, subtyping and method dispatch
Description
Hi,
I just stumbled upon a pecularity when defining certain functions. I am not sure, whether this is expected, but it looks quite frightening from a user perspective.
The following code will kill my julia repl (actually sometimes it resulted in a StackOverflow instead, however now it is always killing it immediately)
Copy paste
const Either{L, R} = Union{Some{L}, Ref{R}}
f(::Type{Either{L2, R}}, ::Type{Either{L1, R}}) where {L1, R, L2 <: L1} = Either{L1, R}
f(::Type{Either{L, R1}}, ::Type{Either{L, R2}}) where {L, R1, R2 <: R1} = Either{L, R1}and boom.
my versions:
julia> versioninfo()
Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
JULIA_NUM_THREADS = 8Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviortypes and dispatchTypes, subtyping and method dispatchTypes, subtyping and method dispatch