]> git.ipfire.org Git - thirdparty/vala.git/commit
genie: Fix parser's inner state when a struct is declared after a class 1384dd0bac5a93721e1ca11efed51fba4cb050ed
authorJeremy Philippe <jeremy.philippe@gmail.com>
Sat, 21 Dec 2019 19:55:53 +0000 (20:55 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 6 Jan 2020 08:29:36 +0000 (09:29 +0100)
commit1384dd0bac5a93721e1ca11efed51fba4cb050ed
treed5f622e449f56958a617d007e79286d82efb3b78
parent4e78d7713e80ce0b3044979e848b78229a1b6061
genie: Fix parser's inner state when a struct is declared after a class

If the struct is declared after a class and has a default creation
method, the parser will raise a "missing return type in method ..."
error.

The cause of the bug is that the global 'class_name' variable is not
updated when the parser encounters a struct, so the previous value
is used, and if a class has been parsed before, this value will be the
name of the class instead of the struct.
tests/Makefile.am
tests/genie/struct-after-class.gs [new file with mode: 0644]
vala/valagenieparser.vala