# Error: \`@compat\` called with wrong number of arguments

**URL:** <https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911>\
**Category:** General Usage\
**Created:** [May 24, 2017, 1:49pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911 "2017-05-24T13:49:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 24, 2017, 1:49pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911/1 "2017-05-24T13:49:43Z")

</div>

Appveyor gets the following error from `Compat 0.25.2` on Julia `0.5.2`:

```julia
ERROR: LoadError: LoadError: syntax: unhandled expr (error #<julia: Base.ArgumentError(msg="@compat called with wrong number of arguments: (:struct,:(MXError <: Exception))")>)
 in include_from_node1(::String) at .\loading.jl:488 (repeats 2 times)
 in macro expansion; at .\none:2 [inlined]
 in anonymous at .\<missing>:?
 in eval(::Module, ::Any) at .\boot.jl:234
 in process_options(::Base.JLOptions) at .\client.jl:242
 in _start() at .\client.jl:321
while loading C:\Users\appveyor\.julia\v0.5\MXNet\src\base.jl, in expression starting on line 1
while loading C:\Users\appveyor\.julia\v0.5\MXNet\src\MXNet.jl, in expression starting on line 24
ERROR: LoadError: Failed to precompile MXNet to C:\Users\appveyor\.julia\lib\v0.5\MXNet.ji.
 in compilecache(::String) at .\loading.jl:593
 in require(::Symbol) at .\loading.jl:422
 in include_from_node1(::String) at .\loading.jl:488
 in process_options(::Base.JLOptions) at .\client.jl:265
 in _start() at .\client.jl:321
while loading C:\Users\appveyor\.julia\v0.5\MXNet\test\runtests.jl, in expression starting on line 1

```

When I test locally on 0.6 I get no errors. I suppose this is not too surprising since `Compat` probably sees that it is on 0.6 and doesn’t get called. I guess my question is, is it even possible to use `@compat` on `struct`, and, if so, what’s causing this error?

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [May 24, 2017, 2:07pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911/2 "2017-05-24T14:07:13Z")

</div>

> [@ExpandingMan](#):
>
> I guess my question is, is it even possible to use @compat on struct

No.

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 24, 2017, 2:40pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911/3 "2017-05-24T14:40:30Z")

</div>

Does this mean all `struct`s have to be reverted to `type`? What about `mutable struct`?

This seems non-ideal as it will have everybody sticking with `type` and `immuatble` until 0.7.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [May 24, 2017, 2:58pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911/4 "2017-05-24T14:58:31Z")

</div>

Syntax changes are hard. This was the best we could do. In 0.7, the old syntaxes will be deprecated, so you can run your code on 0.7 and get feedback on what to change. You should then immediately switch to 1.0 – released at the same time – where the old syntax will simply be an error.

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [May 24, 2017, 3:07pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911/5 "2017-05-24T15:07:32Z")

</div>

Well, my philosophy is usually “update your shit”, so, especially considering Julia is pre-1.0, I’d be perfectly happy to just use 0.6 and not use `Compat` at all, but I doubt I can persuade everyone to have the same attitude. Thanks.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [May 24, 2017, 3:20pm UTC](https://discourse.julialang.org/t/error-compat-called-with-wrong-number-of-arguments/3911/6 "2017-05-24T15:20:46Z")

</div>

If you’re supporting 0.6, you basically have to use the old syntax, which I agree is unfortunate, but it’s only for a limited time. Once 1.0 is out, we encourage dropping support for older Julias entirely and focusing exclusively on moving to 1.0 for all code bases.
