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

Type inference infinite loop? #19570

Closed
Sacha0 opened this issue Dec 13, 2016 · 2 comments · Fixed by #21933
Closed

Type inference infinite loop? #19570

Sacha0 opened this issue Dec 13, 2016 · 2 comments · Fixed by #21933
Labels
compiler:inference Type inference

Comments

@Sacha0
Copy link
Member

Sacha0 commented Dec 13, 2016

Under

julia> versioninfo()
Julia Version 0.6.0-dev.1529
Commit 9ae5e06* (2016-12-08 23:28 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin15.6.0)
  CPU: Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, ivybridge)

the following works as expected

julia> begin
           foo(args...) = bar(((),), (), args...)
           bar(scals, mats, lastarg::SparseMatrixCSC) = (scals..., ()), (mats..., lastarg)
           bar(scals, mats, nextarg, remargs...) = bar((Base.front(scals)..., (last(scals)..., nextarg)), mats, remargs...)
           # bar(scals, mats, nextarg::SparseMatrixCSC, remargs...) = bar((scals..., ()), (mats..., nextarg), remargs...)
       end
bar (generic function with 2 methods)

julia> foo(1.0, speye(2))
(((1.0,),()),(

	[1, 1]  =  1.0
	[2, 2]  =  1.0,))

but the same with the additional bar definition uncommented hangs indefinitely, and on interrupt the trace points to inference. Note that replacing the body of the commented bar definition with e.g. println("narwhal") works fine as well. Best!

(Originally posted to discourse.)

@kshyatt kshyatt added the compiler:inference Type inference label Dec 13, 2016
@KristofferC
Copy link
Member

Still happens.

@vtjnash
Copy link
Member

vtjnash commented May 25, 2017

This looks like the sort of bug that #21933 should fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:inference Type inference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants