ceylon / ceylon-spec

DEPRECATED
Apache License 2.0
108 stars 34 forks source link

anonymous class and value constructor self references #1448

Closed gavinking closed 8 years ago

gavinking commented 8 years ago

According to the spec, the type checker should reject this:

object foobar {
    print(foobar.hash);
}

It does reject this:

object foobar {
    print(hash);
}

And this:

object foobar {
    print(this.hash);
}

Interestingly, it also rejects this:

class Foobar {
    shared new foobar {}
    print(foobar.hash);
}

However, the code path for, and specification of why, this should be rejected is totally separate. It should be unified, and treated as a "self reference".

gavinking commented 8 years ago

Fixed.