diff options
author | Jürg Billeter <j@bitron.ch> | 2010-03-13 17:32:48 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2010-03-13 17:33:54 +0100 |
commit | c5ea5f55ab483330858a2d374ff13e7f45d9a2b8 (patch) | |
tree | be59dff3ade94435838310765f7db3a7a8b84510 /vala/valatuple.vala | |
parent | 96e69a7a555c76a8915171444e69516571fdd22d (diff) | |
download | vala-c5ea5f55ab483330858a2d374ff13e7f45d9a2b8.tar.gz |
Report error on use of tuples
Tuples are not supported as primary expressions.
Based on patch by Adam Folmert, fixes bug 597955.
Diffstat (limited to 'vala/valatuple.vala')
-rw-r--r-- | vala/valatuple.vala | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/vala/valatuple.vala b/vala/valatuple.vala index 0efab3e46..b723d391d 100644 --- a/vala/valatuple.vala +++ b/vala/valatuple.vala @@ -1,6 +1,6 @@ /* valatuple.vala * - * Copyright (C) 2006-2008 Jürg Billeter + * Copyright (C) 2006-2010 Jürg Billeter * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -28,7 +28,8 @@ using GLib; public class Vala.Tuple : Expression { private List<Expression> expression_list = new ArrayList<Expression> (); - public Tuple () { + public Tuple (SourceReference? source_reference = null) { + this.source_reference = source_reference; } public void add_expression (Expression expr) { @@ -42,5 +43,17 @@ public class Vala.Tuple : Expression { public override bool is_pure () { return false; } + + public override bool check (SemanticAnalyzer analyzer) { + if (checked) { + return !error; + } + + checked = true; + + Report.error (source_reference, "tuples are not supported"); + error = true; + return false; + } } |