[Vala] bug: async method containing try-catch clause



Consider this (never mind that the catch clauses
are unreachable, and there is no async call):

class TryCatchBug {
    async void run () {
        string text = "";
        try {
            text = "abc";
        }
        catch (Error e) {
            stderr.printf ("whatever");
        }
        try {
            text = "xyz";
        }
        catch (Error e) {
            stderr.printf ("another whatever");
        }
    }

    public static void main() {
    }
}

valac (0.9.2) compiles the above, but the generated c causes
this error:

   error: duplicate member ‘e’   <-- c compiler error

Quick fix: just change one of the (Error e) to, say, (Error e2).

Is this a known bug?


hand
Nor Jaidi Tuah





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]