# Julia Nightly fails with an error on overwritten method

**URL:** <https://discourse.julialang.org/t/julia-nightly-fails-with-an-error-on-overwritten-method/103358>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [August 30, 2023, 9:56am UTC](https://discourse.julialang.org/t/julia-nightly-fails-with-an-error-on-overwritten-method/103358 "2023-08-30T09:56:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitry-kabanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmitry-kabanov/32/52639_2.png) [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Post date:** [August 30, 2023, 9:56am UTC](https://discourse.julialang.org/t/julia-nightly-fails-with-an-error-on-overwritten-method/103358/1 "2023-08-30T09:56:33Z")

</div>

I need to work with someone else’s code repository and I have zero experience in Julia (although I know how to program). This code repository runs workflows on GitHub Actions, and one of the workflows that runs under Julia nightly version, fails with the following error:

```julia
WARNING: Method definition eval(Any) in module OpenInterfaces at /home/runner/work/open-interfaces/open-interfaces/lang_julia/package/src/OpenInterfaces.jl:1 overwritten at /home/runner/work/open-interfaces/open-interfaces/lang_julia/package/src/OpenInterfaces.jl:18.
ERROR: LoadError: Method overwriting is not permitted during Module precompile.

```

When I look at the module `OpenInterfaces.jl`, the code looks like this (I left only relevant staff):

```julia
module OpenInterfaces

function eval(expression)
    ret = @ccall "liboif_connector".oif_connector_eval_expression(expression::Cstring)::Cint
    check_call(ret, "cannot eval $expression")
end
end

```

What I do not understand is that I do not see any rewrite of the function `eval` in this module. The Julia manual on modules says that each module is a separate namespace, so it seems that there is no implicit override of this method from built-in Julia libraries. At the same time the warning implies that at line 1 of this module (at the very beginning) somehow the function `eval` is already defined.

Could someone explain to me the issue and how to fix it? Thanks!

---

<div class="post-metadata">

**Author:** ![GHTaarn](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ghtaarn/32/216007_2.png) [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Post date:** [August 30, 2023, 12:44pm UTC](https://discourse.julialang.org/t/julia-nightly-fails-with-an-error-on-overwritten-method/103358/2 "2023-08-30T12:44:15Z")

</div>

First of all welcome to discourse. I am not very experienced in using `eval` so I cannot help you much, but Julia automatically defines an `eval` function and an `include` function in every module. You can see this by executing code like:

```julia
module A
end
using Main.A
println(A.eval("Hello"))

```

If you are completely new to Julia, I would suggest playing around with Julia a bit to learn how these functions and keywords work, while at the same time reading the documentation. This looks like some very advanced code.

---

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [August 30, 2023, 1:41pm UTC](https://discourse.julialang.org/t/julia-nightly-fails-with-an-error-on-overwritten-method/103358/3 "2023-08-30T13:41:59Z")

</div>

Perhaps the issue here is that `eval` is a Julia function that’s included by default in each module, and that’s being overwritten by the custom definition in `OpenInterfaces`. If it’s not too much trouble, changing the name of the function should resolve this issue.

---

<div class="post-metadata">

**Author:** ![dmitry-kabanov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dmitry-kabanov/32/52639_2.png) [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Post date:** [August 30, 2023, 3:53pm UTC](https://discourse.julialang.org/t/julia-nightly-fails-with-an-error-on-overwritten-method/103358/4 "2023-08-30T15:53:38Z")

</div>

Dear @GHTaarn and @jishnub, thank you very much for the explanations and advice. I have renamed the function `eval` and the tests run now with the nightly version of Julia.
