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(major = 1)
@TypeParameters(@TypeParameter(value = "Element", variance = Variance.OUT, 
                               satisfies = "ceylon.language.Object"))
@SatisfiedTypes({"ceylon.language.Collection<Element>",
                 "ceylon.language.Cloneable<ceylon.language.Set<Element>>"})
public interface Set<Element> 
        extends Collection<Element> {
    
    @Annotations({@Annotation("actual"), @Annotation("default")})
    @Override
    public long count(java.lang.Object element);

    @Annotations(@Annotation("default"))
    public boolean superset(@TypeInfo("ceylon.language.Set<ceylon.language.Object>") 
                            @Name("set") Set<? extends java.lang.Object> set);
    
    @Annotations(@Annotation("default"))
    public boolean subset(@TypeInfo("ceylon.language.Set<ceylon.language.Object>") 
                          @Name("set") Set<? extends java.lang.Object> set);
    
    @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("formal"))
    @TypeParameters(@TypeParameter(value = "Other", satisfies = "ceylon.language.Object"))
    @TypeInfo("ceylon.language.Set<Element|Other>")
    public <Other> Set<? extends java.lang.Object> union(@TypeInfo("ceylon.language.Set<Other>") 
                             @Name("set") Set<? extends Other> set);
    
    @Annotations(@Annotation("formal"))
    @TypeParameters(@TypeParameter(value = "Other", satisfies = "ceylon.language.Object"))
    @TypeInfo("ceylon.language.Set<Element&Other>")
    public <Other> Set<? extends java.lang.Object> intersection(@TypeInfo("ceylon.language.Set<Other>") 
                                    @Name("set") Set<? extends Other> set);

    @Annotations(@Annotation("formal"))
    @TypeParameters(@TypeParameter(value = "Other", satisfies = "ceylon.language.Object"))
    @TypeInfo("ceylon.language.Set<Element|Other>")
    public <Other> Set<? extends java.lang.Object> exclusiveUnion(@TypeInfo("ceylon.language.Set<Other>") 
                                      @Name("set") Set<? extends Other> set);
    
    @Annotations(@Annotation("formal"))
    @TypeParameters(@TypeParameter(value = "Other", satisfies = "ceylon.language.Object"))
    @TypeInfo("ceylon.language.Set<Element>")
    public <Other> Set<? extends Element> complement(@TypeInfo("ceylon.language.Set<Other>") 
                                      @Name("set") Set<? extends Other> set);

}

@@ -1988,36 +1988,8 @@
  Set
-%3C? extends java.lang.Object%3E
  uni
@@ -2024,32 +2024,32 @@
 e.Set%3COther%3E%22) %0A
+
                 
@@ -2315,36 +2315,8 @@
  Set
-%3C? extends java.lang.Object%3E
  int
@@ -2618,32 +2618,32 @@
 lement%7COther%3E%22)%0A
+
     public %3COthe
@@ -2652,36 +2652,8 @@
  Set
-%3C? extends java.lang.Object%3E
  exc

Fix return type of Set.union() etc, see ceylon/ceylon-compiler#641