# Detect if constant

**URL:** https://discourse.julialang.org/t/detect-if-constant/100246
**Category:** General Usage
**Tags:** constant-propagation
**Created:** [June 12, 2023, 7:56pm UTC](https://discourse.julialang.org/t/detect-if-constant/100246 "2023-06-12T19:56:52Z")
**Posts on this page:** 1
**Showing post:** 23

<div class="post-metadata">

### Author: ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)
#### Post date: [June 15, 2023, 4:15pm UTC](https://discourse.julialang.org/t/detect-if-constant/100246/23 "2023-06-15T16:15:38Z")

</div>

@Sukera you appear to not be understanding the proposal here. This has nothing to do with [Create staticint.jl by Tokazama · Pull Request #44538 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/44538) or using other types to lift values to the type system. This is not a type level dispatch feature they want, but code generation that’s specialized on whether or not a variable has a constant value known to the compiler.

This thread and the github issue perhaps aren’t very clear, so I recommend reading the older thread @per posted: [Branch on whether a value is known to the compiler](https://discourse.julialang.org/t/branch-on-whether-a-value-is-known-to-the-compiler/34850) I think it lays out the idea very clearly.

The requisite information to do this **is** present and known in the compiler, it’s just that a mechanism to do this is not available to users.

---

_[View the full topic](https://discourse.julialang.org/t/detect-if-constant/100246)._
