[vala] codegen: Fix method references in constant initializers
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] codegen: Fix method references in constant initializers
- Date: Mon, 11 Oct 2010 16:19:22 +0000 (UTC)
commit aca1c533a95f98c18fe21364243c36a2f03b4c2e
Author: Jürg Billeter <j bitron ch>
Date: Mon Oct 11 18:18:38 2010 +0200
codegen: Fix method references in constant initializers
codegen/valaccodememberaccessmodule.vala | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valaccodememberaccessmodule.vala b/codegen/valaccodememberaccessmodule.vala
index 110341a..adc5ef8 100644
--- a/codegen/valaccodememberaccessmodule.vala
+++ b/codegen/valaccodememberaccessmodule.vala
@@ -101,7 +101,8 @@ public class Vala.CCodeMemberAccessModule : CCodeControlFlowModule {
} else {
set_delegate_target (expr, new CCodeIdentifier ("data"));
}
- } else {
+ } else if (expr.inner != null) {
+ // expr.inner is null in the special case of referencing the method in a constant initializer
var delegate_target = (CCodeExpression) get_ccodenode (expr.inner);
var delegate_type = expr.target_type as DelegateType;
if ((expr.value_type.value_owned || (delegate_type != null && delegate_type.is_called_once)) && expr.inner.value_type.data_type != null && expr.inner.value_type.data_type.is_reference_counting ()) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]