diff options
author | Luca Bruno <lucabru@src.gnome.org> | 2011-08-07 12:44:41 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-10-23 18:45:45 +0200 |
commit | 6395a2efe8f166fe8b2595fc2ba08dc4bcc69216 (patch) | |
tree | 330e9fd04c476190b76ccc8710ca1d9dd8573fa8 /vala/valathrowstatement.vala | |
parent | 6c44fc72635e0a55f57bb9db526c4d83ddd551df (diff) | |
download | vala-6395a2efe8f166fe8b2595fc2ba08dc4bcc69216.tar.gz |
Collect error_types on demand to allow transformations
Diffstat (limited to 'vala/valathrowstatement.vala')
-rw-r--r-- | vala/valathrowstatement.vala | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/vala/valathrowstatement.vala b/vala/valathrowstatement.vala index d4cade7a2..9349b1818 100644 --- a/vala/valathrowstatement.vala +++ b/vala/valathrowstatement.vala @@ -72,6 +72,15 @@ public class Vala.ThrowStatement : CodeNode, Statement { } } + public override void get_error_types (Collection<DataType> collection, SourceReference? source_reference = null) { + if (source_reference == null) { + source_reference = this.source_reference; + } + var error_type = error_expression.value_type.copy (); + error_type.source_reference = source_reference; + collection.add (error_type); + } + public override bool check (CodeContext context) { if (checked) { return !error; @@ -107,11 +116,6 @@ public class Vala.ThrowStatement : CodeNode, Statement { } } - var error_type = error_expression.value_type.copy (); - error_type.source_reference = source_reference; - - add_error_type (error_type); - return !error; } |