# Broke my Module?

**URL:** <https://discourse.julialang.org/t/broke-my-module/74964>\
**Category:** General Usage\
**Created:** [January 21, 2022, 1:44am UTC](https://discourse.julialang.org/t/broke-my-module/74964 "2022-01-21T01:44:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [January 21, 2022, 1:44am UTC](https://discourse.julialang.org/t/broke-my-module/74964/1 "2022-01-21T01:44:29Z")

</div>

I wrote my own module that contains various structs and methods which act on them. My typical process is to have on the left a script that loads my module and on the right the module source code. I have been using `Revise.jl` so I don’t have to recompile each time I make a change.

I have no idea what I did, but now when I first start up VSCode and run my script for the first time I see the following error.

```julia
WARNING: Method definition (::Type{MyModule.MyMethod})(MyModule.MyMethod, Float64, Float64) in module MyModuleat /PATH/MyModule/src/MyModule.jl:76 overwritten at /PATH/MyModule/src/MyModule.jl:82.
  **incremental compilation may be fatally broken for this module**

```

Everything _appears_ to still work though. Still, I’d like to fix it if possible.  
Any ideas what I did and how I might fix it?

---

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [January 21, 2022, 2:53am UTC](https://discourse.julialang.org/t/broke-my-module/74964/2 "2022-01-21T02:53:58Z")

</div>

I seemed to have fixed it. I think this was my problem. I was making changes to my code and basically (on accident) made some outer constructors equivalent to the `struct` definition. Something like

```julia
struct MyStruct
    Stuff1
    Stuff2
end

function MyStruct(Stuff1, Stuff2)
    # Some old code here that had been commented out, did some setup that i no longer need. 
    return MyStruct(Stuff1, Stuff2)
end

```

Once I removed the function I stopped getting the compilation error.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [January 22, 2022, 10:46am UTC](https://discourse.julialang.org/t/broke-my-module/74964/3 "2022-01-22T10:46:11Z")

</div>

The error message usually means the function at line 76 has the same type signature as the one at line 82.

And, as you found out, this will occur when you’re developing code by hacking away. I’ve even had it where I have ended up with both functions having the same body too, without noticing!
