After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 655343 - You can write destructor wrong and it works anyway
You can write destructor wrong and it works anyway
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Parser
0.13.x
Other Linux
: Normal minor
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-07-26 13:09 UTC by Valentín Barros
Modified: 2014-11-25 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The same example code used in the description (222 bytes, text/x-vala)
2011-07-26 13:09 UTC, Valentín Barros
  Details
patch to fix this (2.37 KB, patch)
2011-12-20 06:12 UTC, Aaron Andersen
none Details | Review

Description Valentín Barros 2011-07-26 13:09:17 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");
	}
}
Comment 1 Aaron Andersen 2011-12-20 06:12:40 UTC
Created attachment 203933 [details] [review]
patch to fix this
Comment 2 Luca Bruno 2011-12-20 10:22:32 UTC
(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.
Comment 3 Colin Walters 2014-09-26 12:55:24 UTC
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
Comment 4 Zeeshan Ali 2014-09-30 14:49:06 UTC
(In reply to comment #3)
> This change broke several previously working codebases, such as libgee and
> geary.

Whats the error/issue?
Comment 5 Luca Bruno 2014-11-25 10:02:24 UTC
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.