ceylon/ceylon-compiler — Issue #263: hash attribute not properly typed
Author: FroMage
Created: 2011-12-05 10:09:15+00:00
State: open
Labels: BUG, high priority

So following #243 we properly type `hashCode()` to `int` when it's implemented as a method, but not when it's implemented as an attribute:

```java
class ExtendsObjectWithEquality() extends Object() satisfies Equality{
shared actual Boolean equals(Equality that) {
return true;
}
shared actual Integer hash = +0;
shared actual String string = "";
}
```

Which results in (among other things):

```java
class ExtendsObjectWithEquality extends .java.lang.Object {

private final long hash;

public final int hashCode() {
return this.hash;
}

ExtendsObjectWithEquality() {
super();
this.hash = 0L;
this.string = "";
}
}
```

So we need to special-case the `hash` attribute type as well :(