Consider:
class A { constant x = -1; string f() { return ([1: "foo"])[x] || "bar"; // Warning: Indexing on illegal type. Got int(-1..-1) } }
class B { inherit A; constant x = 1; }
int main() { werror ("%O\n", B()->f()); }
This gives a warning on the indicated line. I guess the assumption is that x is constant there, but that's not necessarily true as the example shows.
I guess the problem here again is that constants lack explicit types. If it was possible to type it then one would normally write "constant int x = -1;" and the situation wouldn't occur.