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

Specialize ∘ on type arguments? #34849

Closed
jw3126 opened this issue Feb 23, 2020 · 2 comments · Fixed by #35980
Closed

Specialize ∘ on type arguments? #34849

jw3126 opened this issue Feb 23, 2020 · 2 comments · Fixed by #35980

Comments

@jw3126
Copy link
Contributor

jw3126 commented Feb 23, 2020

The following does not infer:

julia> f(itr) = map(Intsign, itr)
f (generic function with 2 methods)

julia> f((1,))
(1,)

julia> @code_warntype f((1,))
Variables
  #self#::Core.Compiler.Const(f, false)
  itr::Tuple{Int64}

Body::Tuple{Any}
1%1 = (Main.Int  Main.sign)::Core.Compiler.Const(Base.var"#56#57"{DataType,typeof(sign)}(Int64, sign), false)
│   %2 = Main.map(%1, itr)::Tuple{Any}
└──      return %2

This occured here.

@tkf
Copy link
Member

tkf commented Feb 23, 2020

This is because closures capture types as DataTypes #23618 (comment)

It's easy to "fix" this for but it'd be great if it can be fixed for all closures.

@jw3126
Copy link
Contributor Author

jw3126 commented Feb 24, 2020

Ok I close this as it is a dup of #23618

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

Successfully merging a pull request may close this issue.

2 participants