# Warning: Method definition (::Type{SIM.simulation})() in module SIM at /home/Desktop/myFile.jl:57 overwritten at /home/Desktop/myFile.jl:57

**URL:** <https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762>\
**Category:** General Usage\
**Created:** [May 30, 2019, 10:25am UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762 "2019-05-30T10:25:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [May 30, 2019, 10:25am UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762/1 "2019-05-30T10:25:49Z")

</div>

The code works earlier. But when I run it this time, I got the above warning as indicated by the title. I checked the line 57 of the file myFile.jl, and only to find that it is the constructor definition inside of the mutable struct Simulation. Nothing special. Could anyone please let me know how to resolve this warning issue?

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [May 30, 2019, 10:48am UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762/2 "2019-05-30T10:48:46Z")

</div>

Isn’t it just that you redefine the method every time you include the file, and thus get a warning that the method has been redefined?

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [May 30, 2019, 10:59am UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762/3 "2019-05-30T10:59:40Z")

</div>

Nice explanations I should say. 🙂 If I understand it correctly, I only include the file once, right? I mean, this file is included in the module file SIM. The module is only used once in my mode by  
`using SIM`. Oh. I think I kind of know the reasons. In the driver file, my code is as the following:

```julia
push!(LOAD_PATH, "directory_to_SIM_module")
using SIM

```

So I guess I only need to stop and restart Julia again from a clean working environment session.

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [May 30, 2019, 6:45pm UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762/4 "2019-05-30T18:45:42Z")

</div>

Does not quite work out. I still get this warning message even for a brand-new REPL Julius session.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [May 30, 2019, 7:04pm UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762/5 "2019-05-30T19:04:21Z")

</div>

To understand your problem, seeing the code that causes it would be very helpful

---

<div class="post-metadata">

**Author:** ![bsnyh](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Post date:** [May 31, 2019, 1:23pm UTC](https://discourse.julialang.org/t/warning-method-definition-type-sim-simulation-in-module-sim-at-home-desktop-myfile-jl-57-overwritten-at-home-desktop-myfile-jl-57/24762/6 "2019-05-31T13:23:48Z")

</div>

I finally figured it out. It is mainly because I have included the same file twice in the module SIM using `include("my_file.jl")`
