[vala/0.34] codegen: Avoid possible conflicts with internal property/signal defines



commit f0c2d8d4b852b41e2772af1bd7e00a93aecb19c6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Oct 25 13:10:41 2017 +0200

    codegen: Avoid possible conflicts with internal property/signal defines
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788964

 codegen/valagtypemodule.vala |    2 +-
 tests/Makefile.am            |    1 +
 tests/objects/bug788964.vala |   11 +++++++++++
 3 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagtypemodule.vala b/codegen/valagtypemodule.vala
index d279d94..8a04a68 100644
--- a/codegen/valagtypemodule.vala
+++ b/codegen/valagtypemodule.vala
@@ -554,7 +554,7 @@ public class Vala.GTypeModule : GErrorModule {
                }
 
                prop_enum = new CCodeEnum ();
-               prop_enum.add_value (new CCodeEnumValue ("%s_DUMMY_PROPERTY".printf 
(get_ccode_upper_case_name (cl, null))));
+               prop_enum.add_value (new CCodeEnumValue ("%s_0_PROPERTY".printf (get_ccode_upper_case_name 
(cl, null))));
                class_init_context = new EmitContext (cl);
                base_init_context = new EmitContext (cl);
                class_finalize_context = new EmitContext (cl);
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 912bc33..d27c594 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -192,6 +192,7 @@ TESTS = \
        objects/bug766739.vala \
        objects/bug779219.vala \
        objects/bug783897.vala \
+       objects/bug788964.vala \
        errors/errors.vala \
        errors/bug567181.vala \
        errors/bug579101.vala \
diff --git a/tests/objects/bug788964.vala b/tests/objects/bug788964.vala
new file mode 100644
index 0000000..4865568
--- /dev/null
+++ b/tests/objects/bug788964.vala
@@ -0,0 +1,11 @@
+public class Foo : Object {
+       public signal void last ();
+}
+
+public class Bar : Object {
+       public string dummy { get; set; }
+       public string last { get; set; }
+}
+
+void main () {
+}


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