# MacroTools splitarg interface change RFC

**URL:** <https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885>\
**Category:** General Usage\
**Created:** [January 1, 2022, 12:01am UTC](https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885 "2022-01-01T00:01:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![willow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/willow/32/208918_2.png) [@willow](https://discourse.julialang.org/u/willow)\
**Post date:** [January 1, 2022, 12:01am UTC](https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885/1 "2022-01-01T00:01:41Z")

</div>

MacroTools `splitarg` and `combinearg` no longer work with functions that have keyword argument splats in Julia 1.7. To fix this [issue](https://github.com/FluxML/MacroTools.jl/issues/177), we need to avoid trying to typeassert the keyword argument splat. MacroTools used to return `:Any` in the `arg_type` field of `splitarg` when an argument had no type, which when passed to `combinearg` transforms `f(; kwargs...)` into `f(; kwargs::Any...)`, an error on Julia 1.7.

Any change to `splitarg` and `combinearg` capable of fixing this error seems to involve changing the interface to these functions. Therefore, we request users to weigh in [here](https://github.com/FluxML/MacroTools.jl/pull/178).

---

<div class="post-metadata">

**Author:** ![cstjean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cstjean/32/1444_2.png) [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Post date:** [January 1, 2022, 1:26am UTC](https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885/2 "2022-01-01T01:26:54Z")

</div>

To summarize the problem at a high-level, our issue is that

- MacroTools is used in a lot of packages
- The most straight-forward fix involves a change of interface to a fairly obscure function (`splitarg`), suggesting a major version bump (well, in this case minor because it’s 0.x)

I’m not really worried about the interface change per se (users of that function will get errors), but I do wonder if it’s worth pushing `CompatHelper` PRs across the registry for such a minor change. What’s the general community wisdom? Do we just pull the trigger and change the interface?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [January 1, 2022, 7:21am UTC](https://discourse.julialang.org/t/macrotools-splitarg-interface-change-rfc/73885/3 "2022-01-01T07:21:57Z")

</div>

I would do anything possible to not have to release a breaking version. For example, instead of modifying the existing function, make a new function with the correct behaviour. Alt, run tests of packages using the function and fix those that would break from the change preemptively. Etc etc.
