# \#const assignment with other #const variable not working

**URL:** <https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628>\
**Category:** Roku Developer Program\
**Tags:** bug-report\
**Created:** [October 7, 2026, 4:01pm UTC](https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628 "2026-10-07T16:01:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TwitchBronBron](https://sea3.discourse-cdn.com/roku/user_avatar/forum.developer.roku.com/twitchbronbron/32/85_2.png) [@TwitchBronBron](https://forum.developer.roku.com/u/TwitchBronBron)\
**Post date:** [October 7, 2026, 4:01pm UTC](https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628/1 "2026-10-07T16:01:16Z")

</div>

The [BrightScript docs](https://developer.roku.com/dev/docs/conditional-compilation#:~:text=Examples%20of%20valid%20expressions) show that you can assign a #const to the value of another const. But at runtime, this doesn’t work.

```auto
#const someFlag = true
#const anotherFlag = false
#const someOtherFlag = someFlag ' ~~~this does't work

```

Here’s what happens when I run that on-device:

 ![image](https://us1.discourse-cdn.com/roku/original/1X/58abeab617c46f289a618f2d0aea7aa11db1e575.png)

Did this used to work and is now broken? Would be a useful feature to have! But either way, the docs could probably use an update to show what’s actually possible.

---

<div class="post-metadata">

**Author:** ![RokuBen](https://sea3.discourse-cdn.com/roku/user_avatar/forum.developer.roku.com/rokuben/32/61_2.png) [@RokuBen](https://forum.developer.roku.com/u/RokuBen)\
**Post date:** [October 7, 2026, 4:21pm UTC](https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628/2 "2026-10-07T16:21:14Z")

</div>

I can confirm this is broken in BrightScript versus the docs right now. I’ve put my best “agent” on the case.

---

<div class="post-metadata">

**Author:** ![ldiamand](https://avatars.discourse-cdn.com/v4/letter/l/d6d6ee/32.png) [@ldiamand](https://forum.developer.roku.com/u/ldiamand)\
**Post date:** [October 12, 2026, 10:39am UTC](https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628/3 "2026-10-12T10:39:15Z")

</div>

I don’t think this has ever been supported. Looking in the code it looks like there was a plan to add this, but today it only supports boolean expressions after the “=”.

---

<div class="post-metadata">

**Author:** ![RokuJonathanD](https://sea3.discourse-cdn.com/roku/user_avatar/forum.developer.roku.com/rokujonathand/32/140_2.png) [@RokuJonathanD](https://forum.developer.roku.com/u/RokuJonathanD)\
**Post date:** [November 16, 2026, 8:54pm UTC](https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628/4 "2026-11-16T20:54:14Z")

</div>

Thanks for the report. The Conditional compilation page has been updated to match the current behavior:

- The form now reads `#const <constant-name> = <boolean>`, and the value must be the literal `true` or `false`.
- The `#const someOtherFlag = someFlag` example is removed.
- A new criteria bullet states that a constant cannot be assigned the value of another constant.

The change is merged in the docs source, and the updated page is now live on [developer.roku.com](http://developer.roku.com).

---

<div class="post-metadata">

**Author:** ![TwitchBronBron](https://sea3.discourse-cdn.com/roku/user_avatar/forum.developer.roku.com/twitchbronbron/32/85_2.png) [@TwitchBronBron](https://forum.developer.roku.com/u/TwitchBronBron)\
**Post date:** [November 16, 2026, 9:05pm UTC](https://forum.developer.roku.com/t/const-assignment-with-other-const-variable-not-working/11628/5 "2026-11-16T21:05:27Z")

</div>

Thanks for getting the docs updated! Is there a way to have this filed as a feature request? It would be really nice to be able to support this feature in our conditional compile logic.
