FUTURE: Constant evaluation needs on-demand resolving

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=3006

Reported by Martin Nilsson, IDA nilsson@pike.ida.liu.se

From testsuite:

testsuite: Test 433 (shift 1) (CRNL):7:Illegal program identifier
(type:int).
testsuite: Test 433 (shift 1) (CRNL):9:Class definition failed.
testsuite: Test 433 (shift 1) (CRNL) failed.
  1: mixed a() {
  2:   class X {
  3:     constant foo = Foo;
  4:     class Foo {}
  5:     void bar()
  6:     {
  7:       foo f = Foo();
  8:     }
  9:   };
 10: ; }