diff options
author | Jürg Billeter <j@bitron.ch> | 2008-11-29 23:55:28 +0000 |
---|---|---|
committer | Jürg Billeter <juergbi@src.gnome.org> | 2008-11-29 23:55:28 +0000 |
commit | 1161589c702601e6561e4b3650eac0b5a7990c59 (patch) | |
tree | cbea3a6c69f4a779e4ca9b8f41121fd2c9b8c5fb /vala/valathrowstatement.vala | |
parent | 1e46e5859b50af8fee5aa0b43a7ccc470bdbd19b (diff) | |
download | vala-1161589c702601e6561e4b3650eac0b5a7990c59.tar.gz |
Check type of error expression in throw statements
2008-11-30 Jürg Billeter <j@bitron.ch>
* vala/valathrowstatement.vala:
Check type of error expression in throw statements
svn path=/trunk/; revision=2090
Diffstat (limited to 'vala/valathrowstatement.vala')
-rw-r--r-- | vala/valathrowstatement.vala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vala/valathrowstatement.vala b/vala/valathrowstatement.vala index 3732b1135..2380d2fdd 100644 --- a/vala/valathrowstatement.vala +++ b/vala/valathrowstatement.vala @@ -85,6 +85,12 @@ public class Vala.ThrowStatement : CodeNode, Statement { if (error_expression != null) { error_expression.check (analyzer); + + if (!(error_expression.value_type is ErrorType)) { + Report.error (error_expression.source_reference, "`%s' is not an error type".printf (error_expression.value_type.to_string ())); + error = true; + return false; + } } var error_type = error_expression.value_type.copy (); |