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.SatisfiedTypes;
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
@TypeParameters(@TypeParameter(value = "Element", variance = Variance.OUT))
@SatisfiedTypes({"ceylon.language.Collection<Element>",
                 "ceylon.language.Correspondence<ceylon.language.Integer,Element>",
                 "ceylon.language.Ranged<ceylon.language.Integer,ceylon.language.List<Element>>",
                 "ceylon.language.Cloneable<ceylon.language.List<Element>>"})
public interface List<Element> 
        extends Collection<Element>, 
                Correspondence<Integer,Element>,
                Ranged<Integer, List<? extends Element>> {

    @Annotations(@Annotation("formal"))
    @TypeInfo("ceylon.language.Nothing|ceylon.language.Integer")
    public Integer getLastIndex();
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public long getSize();
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public boolean defines(@Name("index") Integer key);
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @TypeInfo("ceylon.language.Nothing|Element")
    @Override
    public Element item(@Name("index") Integer key);
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @TypeInfo("ceylon.language.Iterator<Element>")
    @Override
    public Iterator<? extends Element> getIterator();
    
    /*@Override
    public List<? extends Element> span(@Name("from") Integer from, 
            @TypeInfo("ceylon.language.Nothing|ceylon.language.Integer")
            @Name("to") Integer to);
    
    @Override
    public List<? extends Element> segment(@Name("from") Integer from, 
            @Name("length") Integer length);*/
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public boolean equals(@Name("that") @TypeInfo("ceylon.language.Object")
    java.lang.Object that);
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public int hashCode();
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public java.lang.String toString();
    
}

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.SatisfiedTypes;
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
@TypeParameters(@TypeParameter(value = "Element", variance = Variance.OUT))
@SatisfiedTypes({"ceylon.language.Collection<Element>",
                 "ceylon.language.Correspondence<ceylon.language.Integer,Element>",
                 "ceylon.language.Ranged<ceylon.language.Integer,ceylon.language.List<Element>>",
                 "ceylon.language.Cloneable<ceylon.language.List<Element>>"})
public interface List<Element> 
        extends Collection<Element>, 
                Correspondence<Integer,Element>,
                Ranged<Integer, List<? extends Element>> {

    @Annotations(@Annotation("formal"))
    @TypeInfo("ceylon.language.Nothing|ceylon.language.Integer")
    public Integer getLastIndex();
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public long getSize();
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public boolean defines(@Name("index") Integer key);
    
    @Annotations({@Annotation("actual"), @Annotation("formal")})
    @TypeInfo("ceylon.language.Nothing|Element")
    @Override
    public Element item(@Name("index") Integer key);
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @TypeInfo("ceylon.language.Iterator<Element>")
    @Override
    public Iterator<? extends Element> getIterator();
    
    /*@Override
    public List<? extends Element> span(@Name("from") Integer from, 
            @TypeInfo("ceylon.language.Nothing|ceylon.language.Integer")
            @Name("to") Integer to);
    
    @Override
    public List<? extends Element> segment(@Name("from") Integer from, 
            @Name("length") Integer length);*/
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public boolean equals(@Name("that") @TypeInfo("ceylon.language.Object")
    java.lang.Object that);
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public int hashCode();
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public java.lang.String toString();
    
}

Fix annotation on List.item