[vala] Report error when trying to create an array of delegates with targets
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] Report error when trying to create an array of delegates with targets
- Date: Sat, 16 Oct 2010 07:33:16 +0000 (UTC)
commit d57ead91f95c1c3528be041fdbd37293f347435d
Author: Jürg Billeter <j bitron ch>
Date: Sat Oct 16 09:32:18 2010 +0200
Report error when trying to create an array of delegates with targets
Fixes bug 632017.
codegen/valaccodebasemodule.vala | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/codegen/valaccodebasemodule.vala b/codegen/valaccodebasemodule.vala
index 0575c3e..a8ec581 100644
--- a/codegen/valaccodebasemodule.vala
+++ b/codegen/valaccodebasemodule.vala
@@ -3902,6 +3902,12 @@ public class Vala.CCodeBaseModule : CodeGenerator {
var array_type = type as ArrayType;
if (array_type != null) {
check_type (array_type.element_type);
+ if (array_type.element_type is DelegateType) {
+ var delegate_type = (DelegateType) array_type.element_type;
+ if (delegate_type.delegate_symbol.has_target) {
+ Report.error (type.source_reference, "Delegates with target are not supported as array element type");
+ }
+ }
}
foreach (var type_arg in type.get_type_arguments ()) {
check_type (type_arg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]