ceylon/ceylon-spec — Issue #211: Forbid refinement of static members
Author: FroMage
Created: 2012-02-23 15:42:11+00:00
State: open
Labels: high priority, improvement

Given the following declarations:

```java
// Java
public class JavaWithStaticMembers {
public static void topMethod(){}
public static long topField;
}

// Ceylon
class StaticMethodsOverriding() extends JavaWithStaticMembers() {
shared actual void topMethod(){}
shared actual variable Integer topField := 2;
}
```

We currently end up with this error:

```
/home/stephane/src/java-eclipse/ceylon-compiler/test-src/com/redhat/ceylon/compiler/java/test/interop/StaticMethods.ceylon:108: member refines a non-default, non-formal member
shared actual variable Integer topField := 2;
^
```

This is a bit weird, because the method is not final so I suppose it should be "default". But in any case the typechecker should refuse refinement of static members (both the method and field), because it's not legal in Java.