package ceylon.language;

import com.redhat.ceylon.compiler.java.metadata.Ceylon;
import com.redhat.ceylon.compiler.java.metadata.Class;
import com.redhat.ceylon.compiler.java.metadata.Defaulted;
import com.redhat.ceylon.compiler.java.metadata.Ignore;
import com.redhat.ceylon.compiler.java.metadata.Name;
import com.redhat.ceylon.compiler.java.metadata.TypeInfo;
import com.redhat.ceylon.compiler.java.runtime.model.ReifiedType;
import com.redhat.ceylon.compiler.java.runtime.model.TypeDescriptor;

@Ceylon(major = 6)
@Class(extendsType="ceylon.language::Throwable")
public class Error extends ceylon.language.Throwable /*implements ReifiedType*/ {
    @Ignore
    public final static TypeDescriptor $TypeDescriptor$ = TypeDescriptor.klass(Error.class);

    @Ignore
    public Error() {
        super();
    }

    public Error(
            @TypeInfo("ceylon.language::String|ceylon.language::Null")
            @Name("description")
            @Defaulted
            java.lang.String description,
            @TypeInfo("ceylon.language::Throwable|ceylon.language::Null")
            @Name("cause")
            @Defaulted
            java.lang.Throwable cause) {
        super(description, cause);
    }

    @Ignore
    public Error(@TypeInfo("ceylon.language::String|ceylon.language::Null")
            @Name("description")
            @Defaulted
            java.lang.String description) {
        super(description);
    }
    @Ignore
    public static java.lang.String $default$description(){
        return null;
    }
    @Ignore
    public static java.lang.Throwable $default$cause(String description){
        return null;
    }
    
}

@@ -530,17 +530,19 @@
 endsType
-=
+ = 
 %22ceylon.
@@ -594,36 +594,24 @@
 nds 
-ceylon.language.Throwable /*
+java.lang.Error 
 impl
@@ -632,13 +632,12 @@
 Type
-*/
  %7B%0A
+%0A
     
@@ -724,20 +724,24 @@
 .klass(E
-rror
+xception
 .class);
@@ -746,64 +746,111 @@
 );%0A%0A
-    @Ignore%0A    public Error() %7B%0A        super()
+%09private static final long serialVersionUID = -1790691559137471641L;%0A%0A%09private String description
 ;%0A    
-%7D%0A
 %0A   
@@ -999,34 +999,24 @@
             
-java.lang.
 String descr
@@ -1217,54 +1217,315 @@
 tion
-, cause);%0A    %7D%0A%0A    @Ignore%0A    public Error(
+==null ? null : description.toString(), cause);%0A        this.description = description;%0A    %7D%0A    %0A    @Ignore%0A    public Error(String description) %7B%0A        this(description, $default$cause(description));%0A    %7D%0A    %0A    @Ignore%0A    public Error() %7B%0A        this($default$description());%0A    %7D%0A        %0A    
 @Typ
@@ -1540,38 +1540,41 @@
 eylon.language::
-String
+Throwable
 %7Cceylon.language
@@ -1590,129 +1590,718 @@
     
-        @Name(%22description%22)%0A            @Defaulted%0A            java.lang.String description) %7B%0A        super(description
+public java.lang.Throwable getCause() %7B%0A        return super.getCause();%0A    %7D%0A    %0A    @TypeInfo(%22ceylon.language::String%22)%0A    public java.lang.String getMessage() %7B%0A        if (description != null%0A                && description != null) %7B%0A            return description.toString();%0A        %7D %0A        else if (getCause() != null %0A                && getCause().getMessage() != null) %7B%0A            return getCause().getMessage();%0A        %7D%0A        return %22%22;%0A    %7D%0A%0A    @TypeInfo(%22ceylon.language::String%22)%0A    public java.lang.String toString() %7B%0A        return className_.className(this) + %22 %5C%22%22 + getMessage() +%22%5C%22%22; %0A    %7D%0A    %0A    @Override%0A    public void printStackTrace() %7B%0A    %09super.printStackTrace(
 );%0A 
@@ -2297,32 +2297,33 @@
 kTrace();%0A    %7D%0A
+%0A
     @Ignore%0A    
@@ -2336,26 +2336,16 @@
  static 
-java.lang.
 String $
@@ -2507,15 +2507,116 @@
 ;%0A    %7D%0A
+%0A
     
+@Override%0A    @Ignore%0A    public TypeDescriptor $getType$() %7B%0A        return $TypeDescriptor$;%0A    %7D
 %0A%7D%0A

Add c.l.Error to the runtime, since we don't always erase it (see ceylon/ceylon-compiler#1586).