ID:13812 VHDL error at <location>: can't access enumeration literal to the left of enumeration literal "<name>" in enumeration type <name>

CAUSE: In a VHDL Design File (.vhd) at the specified location, you attempted to access an enumeration literal to the left of the specified enumeration literal in the specified enumeration type. However, the specified enumeration literal is the first enumeration literal in the enumeration type, and therefore it has no enumeration literals to its left for Quartus Prime Integrated Synthesis to access. For example, the 'PRED predefined attribute in the following code attempts to access an enumeration literal that is positioned to the left of enumeration literal st0 in the enumeration type StateType. However, st0 is the first enumeration literal in StateType.
TYPE StateType IS (st0, st1, st2);
SIGNAL current_state: StateType;
SIGNAL next_state: StateType;
 
               
PROCESS(i, current_state)
BEGIN
   current_state <= st2;
   CASE current_state is
      WHEN st2 =>
         next_state <= StateType'PRED(st0);
      WHEN others =>
         next_state <= st2;
   END CASE;
END PROCESS;

            

ACTION: Make sure you do not try to access an enumeration literal that is positioned to the left of the first enumeration literal in an enumeration type.