A module constant's initializer refers back to the constant itself, directly or through other constants, so it has no starting value. Constants are computed once, in dependency order.
Wrong#
let A = B + 1
let B = A + 1Fixed#
let A = 1
let B = A + 1Common causes#
- Two constants defined in terms of each other.
- A constant whose initializer calls a function that reads the constant.
- Give one of them a literal value, or compute the pair in a function.