[vala] Warn about unhandled errors in property accessors



commit a019dcc941ec8439a576fd96289a7c95413a15ed
Author: Jürg Billeter <j bitron ch>
Date:   Sun Sep 13 21:52:42 2009 +0200

    Warn about unhandled errors in property accessors

 vala/valapropertyaccessor.vala |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/vala/valapropertyaccessor.vala b/vala/valapropertyaccessor.vala
index b37f08e..2a21201 100644
--- a/vala/valapropertyaccessor.vala
+++ b/vala/valapropertyaccessor.vala
@@ -201,6 +201,12 @@ public class Vala.PropertyAccessor : Symbol {
 			}
 
 			body.check (analyzer);
+
+			foreach (DataType body_error_type in body.get_error_types ()) {
+				if (!((ErrorType) body_error_type).dynamic_error) {
+					Report.warning (body_error_type.source_reference, "unhandled error `%s'".printf (body_error_type.to_string()));
+				}
+			}
 		}
 
 		analyzer.current_symbol = old_symbol;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]