-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
map(::Type, ::AbstractArray)
may be concretely inferred
#46331
Comments
map(::Type, ::AbstractArary)
may be concretely inferredmap(::Type, ::AbstractArray)
may be concretely inferred
Note this comes explicitly from Line 180 in 6f8e24c
Line 755 in 6f8e24c
and then that function makes it even worse Line 759 in 6f8e24c
n.b. we currently assume this for |
What about changing the test Lines 754 to 755 in 6f8e24c
to only testing for concrete types?
This would fix the problem with the parametric type
I ran most of the tests involving
On the other hand, we would still have
and in other cases we even get more precise results:
I have also tried to test for not being a |
This is a somewhat special case for concrete or a
UnionAll
of concrete types, and doesn't hold in general. Looking at an example:In such a case, an operation like
map(A, [1,2,3])
may be concretely inferred, but isn't.Using a function barrier may help avoid issues arising from instabilities, but not all packages have been written with such instabilities in mind, Some benchmarks:
Ideally,
f
should be as performant asg
without the need for a function barrier.Another case is where the mapped type is a supertype:
This may be inferred as a
Vector{Int64}
.Some of this probably requires #42372, so I'm unsure if this may be addressed at present.
The text was updated successfully, but these errors were encountered: