# "Recursive reference to itself" with Optional and ArcPointer

**URL:** <https://forum.modular.com/t/recursive-reference-to-itself-with-optional-and-arcpointer/2884>\
**Category:** Mojo\
**Tags:** mojo-compiler\
**Created:** [March 24, 2026, 11:43am UTC](https://forum.modular.com/t/recursive-reference-to-itself-with-optional-and-arcpointer/2884 "2026-03-24T11:43:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![phomola](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@phomola](https://forum.modular.com/u/phomola)\
**Post date:** [March 24, 2026, 11:43am UTC](https://forum.modular.com/t/recursive-reference-to-itself-with-optional-and-arcpointer/2884/1 "2026-03-24T11:43:26Z")

</div>

Hello, I have the following struct:

```auto
struct S(Movable):
    var x: Optional[ArcPointer[S]]

```

The code doesn’t compile, the error message is: “struct has recursive reference to itself“

Am I overlooking something? The following compiles without errors:

```auto
struct S(Movable):
    var x: ArcPointer[S]

```

---

<div class="post-metadata">

**Author:** ![owenhilyard](https://sea1.discourse-cdn.com/flex001/user_avatar/forum.modular.com/owenhilyard/32/41_2.png) [@owenhilyard](https://forum.modular.com/u/owenhilyard)\
**Post date:** [March 24, 2026, 1:46pm UTC](https://forum.modular.com/t/recursive-reference-to-itself-with-optional-and-arcpointer/2884/2 "2026-03-24T13:46:38Z")

</div>

This is an ongoing compiler bug that the team is aware of.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex001/uploads/modular/original/1X/2751e0fbdc595a99718b216730957e9db4448cfd.jpeg) [@system](https://forum.modular.com/u/system)\
**Post date:** [September 20, 2026, 1:47pm UTC](https://forum.modular.com/t/recursive-reference-to-itself-with-optional-and-arcpointer/2884/3 "2026-09-20T13:47:04Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
