Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-1210206

Compiler allows referencs to this before the constructor is called

    • 1.0beta
    • sparc
    • solaris_2.4
    • Not verified

      The compiler allows the following program:

      class Foo {
          int foo;
       
          Foo() {
              this(this, f());
          }
          Foo(Foo f, int i) {
          }
          int f() {
              return foo;
          }
      }

      Note how it references "this", and "this.f()" before the constructor is called.

            ahoffsunw Arthur Hoff (Inactive)
            ahoffsunw Arthur Hoff (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: