[vala] Allow recursive structs when nullable



commit c3b0ebf98b42ce26c777be9d52447454cea9a4a2
Author: Marc-André Lureau <marcandre lureau gmail com>
Date:   Fri Oct 9 12:09:03 2009 +0200

    Allow recursive structs when nullable
    
    That way:
    
    struct S {
           S? nullable;
    }

 vala/valastruct.vala |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index 0d0d2ed..c376de7 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -743,6 +743,9 @@ public class Vala.Struct : TypeSymbol {
 		if (struct_type != null) {
 			var st = (Struct) struct_type.type_symbol;
 			if (st == this) {
+				if (type.nullable) {
+					return false;
+				}
 				return true;
 			}
 			foreach (Field f in st.fields) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]