]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Report error when throwing internal errors from public methods
authorJürg Billeter <j@bitron.ch>
Tue, 14 Sep 2010 07:34:09 +0000 (09:34 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 14 Sep 2010 07:34:09 +0000 (09:34 +0200)
vala/valamethod.vala

index 446a3f750077bc142a4b9b92965ad3bf541e6cab..d48d356d4a77e9b35e933ae40e90e8fba2723593 100644 (file)
@@ -887,6 +887,13 @@ public class Vala.Method : Symbol {
 
                foreach (DataType error_type in get_error_types ()) {
                        error_type.check (analyzer);
+
+                       // check whether error type is at least as accessible as the method
+                       if (!analyzer.is_type_accessible (this, error_type)) {
+                               error = true;
+                               Report.error (source_reference, "error type `%s` is less accessible than method `%s`".printf (error_type.to_string (), get_full_name ()));
+                               return false;
+                       }
                }
 
                if (result_var != null) {