This patch from Rémy Oudompheng fixes the export and import of the predeclared error type. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 2769c29f2014 go/export.cc --- a/go/export.cc Thu Dec 01 09:07:49 2011 -0800 +++ b/go/export.cc Thu Dec 01 10:31:54 2011 -0800 @@ -337,6 +337,7 @@ this->register_builtin_type(gogo, "uintptr", BUILTIN_UINTPTR); this->register_builtin_type(gogo, "bool", BUILTIN_BOOL); this->register_builtin_type(gogo, "string", BUILTIN_STRING); + this->register_builtin_type(gogo, "error", BUILTIN_ERROR); } // Register one builtin type in the export table. diff -r 2769c29f2014 go/export.h --- a/go/export.h Thu Dec 01 09:07:49 2011 -0800 +++ b/go/export.h Thu Dec 01 10:31:54 2011 -0800 @@ -39,8 +39,9 @@ BUILTIN_STRING = -16, BUILTIN_COMPLEX64 = -17, BUILTIN_COMPLEX128 = -18, + BUILTIN_ERROR = -19, - SMALLEST_BUILTIN_CODE = -18 + SMALLEST_BUILTIN_CODE = -19 }; // This class manages exporting Go declarations. It handles the main diff -r 2769c29f2014 go/import.cc --- a/go/import.cc Thu Dec 01 09:07:49 2011 -0800 +++ b/go/import.cc Thu Dec 01 10:31:54 2011 -0800 @@ -706,6 +706,7 @@ this->register_builtin_type(gogo, "uintptr", BUILTIN_UINTPTR); this->register_builtin_type(gogo, "bool", BUILTIN_BOOL); this->register_builtin_type(gogo, "string", BUILTIN_STRING); + this->register_builtin_type(gogo, "error", BUILTIN_ERROR); } // Register a single builtin type.