eclipse-archived/ceylon

bogus error message in incorrect code

Closed this issue · 1 comments

Given this Java class:

public class Obj {
    public int getInt() {
        return 1;
    }
}

And this Ceylon subclass (which is incorrect):

class X() extends Obj() {
    shared actual Integer? int { return 1; }
}

I get two errors:

type may not be annotated 'small': 'int' has type 'Integer?' (only an 'Integer', 'Float', or 'Character' may be small)
type of member must be assignable to type of refined member 'int' in 'Obj': 'Integer?' is not assignable to 'Integer' (the assigned type contains 'null')

The second is correct. The first is nonsense.

Fixed.