From: Rico Tzschichholz Date: Wed, 21 Jun 2017 11:29:27 +0000 (+0200) Subject: girparser: Fix parsing of delegate-alias without target X-Git-Tag: 0.37.1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e9975cdbd681e82484fea72d8fffd110a4b463d7;p=thirdparty%2Fvala.git girparser: Fix parsing of delegate-alias without target "has_target" is a ccode-attribute-based property, so don't explicitly set it and rely on attribute-list-copy. Otherwise there will a fatal duplicated CCode attribute. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 50708d172..a01cd5bb1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -291,6 +291,7 @@ TESTS = \ gir/bug667751.test \ gir/bug742012.test \ gir/array-fixed-length.test \ + gir/delegate-alias-without-target.test \ annotations/deprecated.vala \ annotations/description.vala \ annotations/noaccessormethod.test \ diff --git a/tests/gir/delegate-alias-without-target.test b/tests/gir/delegate-alias-without-target.test new file mode 100644 index 000000000..1e2fd36a1 --- /dev/null +++ b/tests/gir/delegate-alias-without-target.test @@ -0,0 +1,20 @@ +GIR + +Input: + + + + + + + + + + + +Output: + +[CCode (cheader_filename = "test.h", has_target = false)] +public delegate void Bar (); +[CCode (cheader_filename = "test.h", has_target = false)] +public delegate void Foo (); diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index 08573b677..2acdf7cc7 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -3639,7 +3639,6 @@ public class Vala.GirParser : CodeVisitor { var deleg = new Delegate (alias.name, orig.return_type.copy (), alias.source_reference); deleg.access = orig.access; - deleg.has_target = orig.has_target; foreach (var param in orig.get_parameters ()) { deleg.add_parameter (param.copy ());