# Craeting a @Struct, @Union is it possible to add const fields inside the namespace

**URL:** <https://ziggit.dev/t/craeting-a-struct-union-is-it-possible-to-add-const-fields-inside-the-namespace/15995>\
**Category:** Help\
**Tags:** comptime, type-system\
**Created:** [June 7, 2026, 3:09pm UTC](https://ziggit.dev/t/craeting-a-struct-union-is-it-possible-to-add-const-fields-inside-the-namespace/15995 "2026-06-07T15:09:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SillyProgramming](https://ziggit.dev/user_avatar/ziggit.dev/sillyprogramming/32/8444_2.png) [@SillyProgramming](https://ziggit.dev/u/SillyProgramming)\
**Post date:** [June 7, 2026, 3:09pm UTC](https://ziggit.dev/t/craeting-a-struct-union-is-it-possible-to-add-const-fields-inside-the-namespace/15995/1 "2026-06-07T15:09:37Z")

</div>

I want to generate a struct at comptime with a const field inside the namespace.  
The expected result would be like this.

```rs
const x = struct {
    const desc = "";
}

```

Or this is not permitted for the same reason function are?

---

<div class="post-metadata">

**Author:** ![vulpesx](https://ziggit.dev/user_avatar/ziggit.dev/vulpesx/32/3989_2.png) [@vulpesx](https://ziggit.dev/u/vulpesx)\
**Post date:** [June 7, 2026, 3:13pm UTC](https://ziggit.dev/t/craeting-a-struct-union-is-it-possible-to-add-const-fields-inside-the-namespace/15995/2 "2026-06-07T15:13:23Z")

</div>

It is not possible to add declarations (`const`, `var`, `fn`) to reified types.
