GNOME Bugzilla – Bug 655343
You can write destructor wrong and it works anyway
Last modified: 2014-11-25 10:02:24 UTC
Created attachment 192666 [details] The same example code used in the description Hello. I found that if you misspell the name of a class when creating it's destructor method, everything works OK —I mean, it works the same as if you were written it right. For example, the next code doesn't generate any error —and even the class is using "ZZZzzzZZZ" as a destructor. class Test : Object { public static int main() { new Test("Hello World!!"); return 0; } public Test(string s) { stdout.printf("Test: %s\n", s); } ~ZZZzzzZZZ() { stdout.printf("Destroying Test\n"); } }
Created attachment 203933 [details] [review] patch to fix this
(In reply to comment #1) > Created an attachment (id=203933) [details] [review] > patch to fix this Thanks for the patch. In which case parent_symbol is null? If it's for class/static destructors, that ought to be fixed first then.
This change broke several previously working codebases, such as libgee and geary. I'm tagging vala back in Continuous: https://git.gnome.org/browse/gnome-continuous/commit/?id=3d14fe29db7df07d79f9c109b06e9a55cea1d352
(In reply to comment #3) > This change broke several previously working codebases, such as libgee and > geary. Whats the error/issue?
commit 030f1f124d5e30d4c33e47e2c4ae65972ee3ea81 Author: Florian Brosch <flo.brosch@gmail.com> Date: Sun Sep 14 19:44:25 2014 +0200 Check destructor names Edit: make it an error instead of warning Fixes bug 655343. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.