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 560909 - exceptions suppressed when calling functions nested like this f(g(x))
exceptions suppressed when calling functions nested like this f(g(x))
Status: RESOLVED DUPLICATE of bug 475922
Product: vala
Classification: Core
Component: Errors
0.4.x
Other All
: Normal major
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-11-15 11:28 UTC by Martin Olsson
Modified: 2008-11-15 11:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Martin Olsson 2008-11-15 11:28:51 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:
Comment 1 Jürg Billeter 2008-11-15 11:37:36 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 ***