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.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Name;
import com.redhat.ceylon.compiler.java.metadata.TypeInfo;
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 = 3)
@TypeParameters({
    @TypeParameter(value = "Index", variance = Variance.IN,
    		satisfies="ceylon.language::Comparable<Index>"),
    @TypeParameter(value = "Span", variance = Variance.OUT)
})
public interface Ranged<Index extends Comparable<? super Index>, Span> {
    
    @Annotations(@Annotation("formal"))
	public Span span(@Name("from") Index from, 
			@Name("to") @TypeInfo("ceylon.language::Nothing|Index") Index to);
    
    @Annotations(@Annotation("formal"))
	public Span segment(@Name("from") Index from, @Name("length") long length);
	
}

@@ -891,49 +891,185 @@
 o%22) 
-@TypeInfo(%22ceylon.language::Nothing%7CIndex
+Index to);%0A    %0A    @Annotations(@Annotation(%22formal%22))%0A%09public Span spanFrom(@Name(%22to%22) Index from);%0A    %0A    @Annotations(@Annotation(%22formal%22))%0A%09public Span spanTo(@Name(%22to
 %22) I

Add spanTo and spanFrom for #181