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

StackOverflow in function definition #31082

Closed
blegat opened this issue Feb 15, 2019 · 1 comment
Closed

StackOverflow in function definition #31082

blegat opened this issue Feb 15, 2019 · 1 comment
Assignees
Labels
domain:types and dispatch Types, subtyping and method dispatch

Comments

@blegat
Copy link
Contributor

blegat commented Feb 15, 2019

The following works fine with Julia v1.0 both for defining the function and resolving which method should be called but it fails in Julia v1.1 as follows:

julia> versioninfo()
Julia Version 1.1.0
Commit 80516ca202 (2019-01-21 21:24 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

julia> struct A{B, C} end

julia> f(::A{B, C}, ::Union{C, A{B, C}}, ::Union{B, Real}) where {B, C} = 0
f (generic function with 1 method)

julia> f(::A{B, C}, ::C, ::C) where {B, C} = 1
ERROR: StackOverflowError:
Stacktrace:
 [1] top-level scope at none:0
@JeffBezanson JeffBezanson added the domain:types and dispatch Types, subtyping and method dispatch label Feb 15, 2019
@JeffBezanson
Copy link
Sponsor Member

Looks like potentially the same issue as #30741

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

2 participants