title: Redefining types in Julia: invalid redefinition of constant
body: <p>Lets say I assign a type <code>Person</code> in Julia:</p>
  <pre><code>type Person
      name::String
      male::Bool
      age::Float64
      children::Int
  end
  
  function describe(p::Person)
      println(&quot;Name: &quot;, p.name, &quot; Male: &quot;, p.male)
      println(&quot;Age: &quot;, p.age, &quot; Children: &quot;, p.children)
  end
  
  
  ted = Person(&quot;Ted&quot;,1,55,0)
  
  describe(ted)
  </code></pre>
  <p>Which will output with the function:</p>
  <pre><code>Name: Ted Male: true
  Age: 55.0 Children: 0
  </code></pre>
  <p>Then I modify the features for type <code>Person</code> where I added a new category to the type <code>eyes</code></p>
  <pre><code>type Person
      name::String
      male::Bool
      age::Float64
      children::Int
      eyes::String
  end
  
  
  ted = Person(&quot;Ted&quot;,1,55,0,brown)
  </code></pre>
  <p>If I run the function now I get an error</p>
  <pre><code>Error evaluating REPL:
  invalid redefinition of constant Person
   in include_string at loading.jl:97
  </code></pre>
  <p>What is the best way to work around this when developing new code? other than making a module as suggested in the <a href="https://docs.julialang.org/en/v1/manual/faq/#How-can-I-modify-the-declaration-of-a-type-in-my-session?" rel="noreferrer">julia FAQ</a></p>