<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="type Dev
        child::Ptr{Mod}
end

type Mod
        parent::Ptr{Dev}
end"><pre class="notranslate">type Dev
        child<span class="pl-k">::</span><span class="pl-c1">Ptr{Mod}</span>
<span class="pl-k">end</span>

type Mod
        parent<span class="pl-k">::</span><span class="pl-c1">Ptr{Dev}</span>
<span class="pl-k">end</span></pre></div>
<p dir="auto">results: "ERROR: Mod not defined"</p>
<p dir="auto">in c, i can do<br>
<code class="notranslate">typedef struct Mod Mod;</code><br>
and use <code class="notranslate">Mod *my_mod</code> as opque type (until define <code class="notranslate">Mod</code>)</p>
<p dir="auto">Currently this doesn't work:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="type Foo
    a::Bar
end

type Bar
    b::Foo
end"><pre class="notranslate"><code class="notranslate">type Foo
    a::Bar
end

type Bar
    b::Foo
end
</code></pre></div>
<p dir="auto">A nice way to handle it is to automatically insert forward declarations for all types defined in a file after lowering. That way as long as the types are in the same file it will Just Work™.</p>