package ceylon.language;

import com.redhat.ceylon.compiler.java.metadata.Annotation;
import com.redhat.ceylon.compiler.java.metadata.Annotations;
import com.redhat.ceylon.compiler.java.metadata.CaseTypes;
import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.TypeParameter;
import com.redhat.ceylon.compiler.java.metadata.TypeParameters;
import com.redhat.ceylon.compiler.java.metadata.Variance;

@Ceylon(major = 2)
@TypeParameters(@TypeParameter(value = "Other", variance = Variance.OUT,
    		       satisfies="ceylon.language.Ordinal<Other>"))
@CaseTypes(of = "Other")
public interface Ordinal<Other extends Ordinal<? extends Other>> {

    @Annotations(@Annotation("formal"))
    public Other getSuccessor();

    @Annotations(@Annotation("formal"))
    public Other getPredecessor();
}

@@ -251,24 +251,136 @@
 ata.Ceylon;%0A
+import com.redhat.ceylon.compiler.java.metadata.Name;%0Aimport com.redhat.ceylon.compiler.java.metadata.TypeInfo;%0A
 import com.r
@@ -944,11 +944,178 @@
 essor();
+%0A%0A    @Annotations(@Annotation(%22formal%22))%0A    @TypeInfo(%22ceylon.language.Integer%22)%0A    public long distanceFrom(@Name(%22other%22)%0A        @TypeInfo(%22Other%22) Other other);
 %0A%7D%0A

Define distanceFrom