julia
b8ca7cfa - Improve effects for pairs(::NamedTuple) (#48344)

Commit
2 years ago
Improve effects for pairs(::NamedTuple) (#48344) The `new` syntax as well as the implicit inner constructor introduces an implicit `convert(fieldtype(T, n), x)` for every field. This convert is generally a no-op (because the fieldtype comes from the type parameter, which in turn comes from the type of `x`). However, the compiler cannot prove this and a `convert` call with unknown types taints all effects. Avoid that by manually avoiding the `convert` call. It is a bit ugly, but there isn't really another way to write it at the moment. In the future we may want to have some nicer way to disable the implicit generation of `convert` calls. Co-authored-by: Shuhei Kadowaki <40514306+aviatesk@users.noreply.github.com>
Author
Parents
Loading