Comptime [runtime value]

Compile Log Output:
@as(u8, [runtime value])

I would like to know under what circumstances using @comptimeLog to output condition-related values that trigger @comptimeError will display [runtime value]. I am confused because the code block containing @comptimeError is determined by an if condition based on the value being logged.

  • Any var will display [runtime value]
  • However, you’re still able to use @compileError() and @compileLog() inside a block comparing the value with something - that is, as long as the thing you’re comparing it to is comptime-known
  • E.g. since the 0 in if(i == 0) is comptime-known, the compiler is aware that it can branch off the code at comptime here, but because of semantics it has to pretend it’s not actually aware what i’s value is, even though we just asserted that it’s exactly 0