]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Fix critical when calling generated enum to_string method 0.12
authorJürg Billeter <j@bitron.ch>
Fri, 3 Jun 2011 09:59:47 +0000 (11:59 +0200)
committerJürg Billeter <j@bitron.ch>
Fri, 3 Jun 2011 10:07:01 +0000 (12:07 +0200)
vala/valaenumvaluetype.vala

index 8a5b7d665ddb419cfe52fbc0249946caab2a49f7..c409763feb0e7fbcf01975a98fc4a1911f23a28e 100644 (file)
@@ -1,6 +1,6 @@
 /* valaenumvaluetype.vala
  *
- * Copyright (C) 2009  Jürg Billeter
+ * Copyright (C) 2009-2011  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
@@ -49,6 +49,8 @@ public class Vala.EnumValueType : ValueType {
                        to_string_method.access = SymbolAccessibility.PUBLIC;
                        to_string_method.external = true;
                        to_string_method.owner = type_symbol.scope;
+                       to_string_method.this_parameter = new Parameter ("this", this);
+                       to_string_method.scope.add (to_string_method.this_parameter.name, to_string_method.this_parameter);
                }
                return to_string_method;
        }