GNOME Bugzilla – Bug 560909
exceptions suppressed when calling functions nested like this f(g(x))
Last modified: 2008-11-15 11:37:36 UTC
Please describe the problem: This code triggers some strange behavior in the Vala compiler. First, I get a warning saying: main.vala:17.10-19.2: warning: unreachable catch clause detected However, there is no corresponding warning for the other upper catch clause. I believe both of these catch clauses are valid and should be reachable. I was using valac 0.4.0 on ubuntu when I found this issue. int main (string[] args) { try { GLib.File my_file = File.new_for_path ("this_file_does_not_exist"); GLib.FileInputStream file_stream = my_file.read (null); GLib.DataInputStream elf_stream = new DataInputStream (file_stream); stdout.printf ("whee\n"); } catch (GLib.Error e) { stdout.printf ("doh\n"); } try { GLib.File my_file = File.new_for_path ("this_file_does_not_exist"); GLib.DataInputStream my_stream = new DataInputStream (my_file.read (null)); stdout.printf ("whee\n"); } catch (GLib.Error e) { stdout.printf ("doh\n"); } return 0; } Steps to reproduce: 1. 2. 3. Actual results: Expected results: Does this happen every time? Other information:
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 ***