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 fails on functions with nested generic functions inside let blocks #18201

Closed
simonbyrne opened this issue Aug 23, 2016 · 1 comment
Labels
compiler:inference Type inference types and dispatch Types, subtyping and method dispatch

Comments

@simonbyrne
Copy link
Contributor

I'm not sure if this is a duplicate of the other let block issues, but I came across this:

let
    global foo

    bar(x::Float64) = x+1
    bar(x::Float32) = x+2

    foo(x) = bar(x)
end
julia> @code_warntype foo(1.0)
Variables:
  #self#::#foo
  x::Float64

Body:
  begin 
      return ((Core.getfield)($(QuoteNode(Core.Box(bar))),:contents)::Any)(x::Float64)::Any
  end::Any

This problem goes away if I get rid of the 2nd method for bar.

@simonbyrne simonbyrne added the types and dispatch Types, subtyping and method dispatch label Aug 23, 2016
@tkelman tkelman added the compiler:inference Type inference label Aug 23, 2016
@yuyichao
Copy link
Contributor

Dup of #15276

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

No branches or pull requests

4 participants