package ceylon.language;

import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Method;
import com.redhat.ceylon.compiler.java.metadata.Name;
import com.redhat.ceylon.compiler.java.metadata.Sequenced;
import com.redhat.ceylon.compiler.java.metadata.TypeInfo;
import com.redhat.ceylon.compiler.java.metadata.TypeParameter;
import com.redhat.ceylon.compiler.java.metadata.TypeParameters;

@Ceylon(major = 1)
@Method
public final class first {
    
    private first() {
    }
    
    @TypeInfo("Element|Nothing")
    @TypeParameters(@TypeParameter(value="Element"))
    public static <Element> Element first(@Name("elements") 
    @Sequenced @TypeInfo("ceylon.language.Iterable<Element>")
    final Iterable<? extends Element> elements) {
        java.lang.Object first = elements.getIterator().next();
        if (first instanceof Finished) {
            return null;
        }
        else {
            return (Element) first;
        }
    }
}

@@ -75,16 +75,72 @@
 Ceylon;%0A
+import com.redhat.ceylon.compiler.java.metadata.Ignore;%0A
 import c
@@ -1044,10 +1044,95 @@
 %7D%0A    %7D%0A
+    @Ignore%0A    public static %3CElement%3E Element first() %7B%0A        return null;%0A    %7D%0A
 %7D%0A

handle no arg case