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

Odd error for self referencing struct on Julia v0.7 #22708

Closed
randy3k opened this issue Jul 8, 2017 · 1 comment
Closed

Odd error for self referencing struct on Julia v0.7 #22708

randy3k opened this issue Jul 8, 2017 · 1 comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:inference Type inference

Comments

@randy3k
Copy link
Contributor

randy3k commented Jul 8, 2017

julia> versioninfo()
Julia Version 0.7.0-DEV.844
Commit e90f29db30 (2017-07-07 06:10 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin13.4.0)
  CPU: Intel(R) Core(TM) i5-6500 CPU @ 3.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, skylake)
struct Foo
    x::Ptr{Foo}
end

f(x::Int) = f(Foo, x) 
f(::Type{Foo}, x) = bar("x")
f(x) = x
bar(x) = f(x)

bar(1)
is_derived_type at ./inference.jl:933
jlcall_is_derived_type_1588 at /opt/local/julia-dev/lib/julia/sys.dylib (unknown line)
is_derived_type at ./inference.jl:944
jlcall_is_derived_type_1588 at /opt/local/julia-dev/lib/julia/sys.dylib (unknown line)
is_derived_type at ./inference.jl:933
jlcall_is_derived_type_1588 at /opt/local/julia-dev/lib/julia/sys.dylib (unknown line)
is_derived_type at ./inference.jl:944
jlcall_is_derived_type_1588 at /opt/local/julia-dev/lib/julia/sys.dylib (unknown line)
is_derived_type at ./inference.jl:933
jlcall_is_derived_type_1588 at /opt/local/julia-dev/lib/julia/sys.dylib (unknown line)
is_derived_type at ./inference.jl:944
jlcall_is_derived_type_1588 at /opt/local/julia-dev/lib/julia/sys.dylib (unknown line)
  • it yields the expected result on Julia v0.6.
  • On v0.7, it also yields the expected result if the last line is f(1)
  • more strangely, it yields the correct result if f(1) is executed before bar(1).
@randy3k
Copy link
Contributor Author

randy3k commented Jul 8, 2017

may be related to #21933

@JeffBezanson JeffBezanson added compiler:inference Type inference bug Indicates an unexpected problem or unintended behavior labels Jul 11, 2017
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 compiler:inference Type inference
Projects
None yet
Development

No branches or pull requests

2 participants