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 515735 - exceptions not cought on assigments
exceptions not cought on assigments
Status: RESOLVED DUPLICATE of bug 475922
Product: vala
Classification: Core
Component: Code Generator
0.1.x
Other All
: Normal major
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-11 11:12 UTC by Andreas Brauchli
Modified: 2008-02-29 20:34 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andreas Brauchli 2008-02-11 11:12:15 UTC
code compiles just fine but the resulting binary doesn't handle exceptions as expected.
little testcase which prints out "uncought":

using GLib;
public class Test : Object {
	public static int main(string[] args) {
		string s;
		try {
			s = foo(); // <-- works when removing "s = "
			if (s == null)
				stdout.printf("uncought\n");
		}
		catch(DummyError err) {
			stdout.printf("cought\n");
		}
		return 0;
	}

	public static string foo() throws DummyError {
		throw new DummyError.CATCHME("foo");
	}
}

public errordomain DummyError { CATCHME }
Comment 1 Jürg Billeter 2008-02-12 18:43:34 UTC
Confirming.
Comment 2 Jürg Billeter 2008-02-29 20:34:48 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 475922 ***