]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Allow recursive structs when nullable
authorMarc-André Lureau <marcandre.lureau@gmail.com>
Fri, 9 Oct 2009 10:09:03 +0000 (12:09 +0200)
committerJürg Billeter <j@bitron.ch>
Sun, 11 Oct 2009 15:25:19 +0000 (17:25 +0200)
That way:

struct S {
       S? nullable;
}

vala/valastruct.vala

index 0d0d2ed94740e86270521890f9958e3696278118..c376de773b83d7e6539f15d82e95ac22b4017425 100644 (file)
@@ -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) {