Detect if constant

@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 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 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.

3 Likes