Unlike module constants that can be used in declarations of other module constants regardless of their declaration order, associated constants must be declared in order if they are mutually dependent.
E.g., this works:
const B: u8 = A; // <<<---- OK. A is declared after B but that doesn't matter.
const A: u8 = 0;
But this doesn't:
struct S {}
impl S {
const B: u8 = Self::A; // ERROR: Could not find symbol "A" in this scope.
const A: u8 = 0;
}
When fixing this issue, adjust the recursive_const_... tests which are linked to this issue via GitHub link in the test TODO.
Unlike module constants that can be used in declarations of other module constants regardless of their declaration order, associated constants must be declared in order if they are mutually dependent.
E.g., this works:
But this doesn't:
When fixing this issue, adjust the
recursive_const_...
tests which are linked to this issue via GitHub link in the test TODO.