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

mapslices + argmax -> "fatal error in type inference (type bound)" #46024

Closed
LilithHafner opened this issue Jul 13, 2022 · 4 comments
Closed
Labels
bug Indicates an unexpected problem or unintended behavior duplicate Indicates similar issues or pull requests regression Regression in behavior compared to a previous version

Comments

@LilithHafner
Copy link
Member

LilithHafner commented Jul 13, 2022

nightly

julia> mapslices(argmax, rand(10,10); dims=2)
ERROR: fatal error in type inference (type bound)
Stacktrace:
 [1] mapslices(f::typeof(argmax), A::Matrix{Float64}; dims::Int64)
   @ Base ./abstractarray.jl:2896
 [2] top-level scope
   @ REPL[100]:1

1.8.0-rc1

julia> mapslices(argmax, rand(10,10); dims=2)
10×1 Matrix{Int64}:
  9
  6
  6
  4
  3
  8
  9
 10
  5
  5
@LilithHafner LilithHafner added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Jul 13, 2022
@gbaraldi
Copy link
Member

gbaraldi commented Jul 13, 2022

I'm bisecting ;).
As I was suspecting it's #40996, @mcabbott @oscardssmith

Edit: This is a duplicate of #43064

@LilithHafner LilithHafner added the duplicate Indicates similar issues or pull requests label Jul 13, 2022
@LilithHafner
Copy link
Member Author

Thanks!

@LilithHafner LilithHafner added bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version and removed bug Indicates an unexpected problem or unintended behavior regression Regression in behavior compared to a previous version labels Jul 13, 2022
@mcabbott
Copy link
Contributor

That's a less obscure example than mine, from #40996:

julia> mapslices(tuple, [1 2; 3 4], dims=1)
1×2 Matrix{Tuple{Vector{Int64}}}:
 ([1, 3],)  ([2, 4],)

julia> mapslices(x -> tuple(x), [1 2; 3 4], dims=1)
ERROR: fatal error in type inference (type bound)

@LilithHafner
Copy link
Member Author

I'm going to move these examples back to your issue so it's all in one place.

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 duplicate Indicates similar issues or pull requests regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants