From: Juerg Billeter Date: Sun, 13 Apr 2008 13:34:42 +0000 (+0000) Subject: never use ClassType for ErrorType instances X-Git-Tag: VALA_0_3_1~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b161275881660c2611e4c0b02291b39c15c725a1;p=platform%2Fupstream%2Fvala.git never use ClassType for ErrorType instances 2008-04-13 Juerg Billeter * vala/valaerrortype.vala, vala/valasemanticanalyzer.vala: never use ClassType for ErrorType instances * vapi/glib-2.0.vapi: use errordomains instead of enums with [ErrorDomain] attribute svn path=/trunk/; revision=1205 --- diff --git a/ChangeLog b/ChangeLog index 159bbf9..39beff3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2008-04-13 Jürg Billeter + * vala/valaerrortype.vala, vala/valasemanticanalyzer.vala: never use + ClassType for ErrorType instances + + * vapi/glib-2.0.vapi: use errordomains instead of enums with + [ErrorDomain] attribute + +2008-04-13 Jürg Billeter + * vapigen/valagidlparser.vala: support takes_ownership metadata attribute for method parameters diff --git a/vala/valaerrortype.vala b/vala/valaerrortype.vala index 9d466a4..274cfe6 100644 --- a/vala/valaerrortype.vala +++ b/vala/valaerrortype.vala @@ -39,6 +39,11 @@ public class Vala.ErrorType : ReferenceType { } public override bool compatible (DataType! target_type, bool enable_non_null = true) { + /* temporarily ignore type parameters */ + if (target_type.type_parameter != null) { + return true; + } + var et = target_type as ErrorType; /* error types are only compatible to error types */ diff --git a/vala/valasemanticanalyzer.vala b/vala/valasemanticanalyzer.vala index 9e9b704..4619b53 100644 --- a/vala/valasemanticanalyzer.vala +++ b/vala/valasemanticanalyzer.vala @@ -1166,7 +1166,7 @@ public class Vala.SemanticAnalyzer : CodeVisitor { current_source_file.add_type_dependency (clause.type_reference, SourceFileDependencyType.SOURCE); clause.variable_declarator = new VariableDeclarator (clause.variable_name); - clause.variable_declarator.type_reference = new ClassType (gerror_type); + clause.variable_declarator.type_reference = clause.type_reference.copy (); clause.body.scope.add (clause.variable_name, clause.variable_declarator); } else { diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 7ab206f..8816c33 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -1182,8 +1182,7 @@ namespace GLib { public delegate bool SourceFunc (); - [ErrorDomain] - public enum ThreadError { + public errordomain ThreadError { AGAIN } @@ -1500,8 +1499,7 @@ namespace GLib { public static string display_basename (string! filename); } - [ErrorDomain] - public enum ConvertError { + public errordomain ConvertError { NO_CONVERSION, ILLEGAL_SEQUENCE, FAILED, @@ -1917,8 +1915,7 @@ namespace GLib { /* Spawning Processes */ - [ErrorDomain] - public enum SpawnError { + public errordomain SpawnError { FORK, READ, CHDIR, @@ -2013,8 +2010,7 @@ namespace GLib { /* File Utilities */ - [ErrorDomain] - public enum FileError { + public errordomain FileError { EXIST, ISDIR, ACCES, @@ -2153,8 +2149,7 @@ namespace GLib { /* Shell-related Utilities */ - [ErrorDomain] - public enum ShellError { + public errordomain ShellError { BAD_QUOTING, EMPTY_STRING, FAILED @@ -2168,8 +2163,7 @@ namespace GLib { /* Commandline option parser */ - [ErrorDomain] - public enum OptionError { + public errordomain OptionError { UNKNOWN_OPTION, BAD_VALUE, FAILED @@ -2251,8 +2245,7 @@ namespace GLib { /* Perl-compatible regular expressions */ - [ErrorDomain] - public enum RegexError { + public errordomain RegexError { COMPILE, OPTIMIZE, REPLACE, @@ -2336,8 +2329,7 @@ namespace GLib { /* Simple XML Subset Parser */ - [ErrorDomain] - public enum MarkupError { + public errordomain MarkupError { BAD_UTF8, EMPTY, PARSE, @@ -2386,8 +2378,7 @@ namespace GLib { /* Key-value file parser */ - [ErrorDomain] - public enum KeyFileError { + public errordomain KeyFileError { UNKNOWN_ENCODING, PARSE, NOT_FOUND, @@ -2496,8 +2487,7 @@ namespace GLib { public bool move_item (string! old_uri, string! new_uri) throws BookmarkFileError; } - [ErrorDomain] - public enum BookmarkFileError { + public errordomain BookmarkFileError { INVALID_URI, INVALID_VALUE, APP_NOT_REGISTERED,