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 645788 - Async function with switch statement and compile error.
Async function with switch statement and compile error.
Status: RESOLVED DUPLICATE of bug 596861
Product: vala
Classification: Core
Component: Async
0.11.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-27 00:33 UTC by Kentaro NAKAZAWA
Modified: 2011-03-27 15:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kentaro NAKAZAWA 2011-03-27 00:33:07 UTC
When the following codes are compiled, the compile error is generated.

----------------------------------------------------------------
async void func() {
    switch (0) {
    case 0:
        int tmp;
        break;
    case 1:
        int tmp;
        break;
    }
}

void main() {
    func();
}
----------------------------------------------------------------

$ valac --pkg gio-2.0 bug3.vala
bug3.vala:7.13-7.15: warning: local variable `tmp' declared but never used
        int tmp;
            ^^^
bug3.vala:10.13-10.15: warning: local variable `tmp' declared but never used
        int tmp;
            ^^^
/home/kentaro/work/VALA/bug3.vala.c:19:7: error: duplicate member ‘tmp’
error: cc exited with status 256
Compilation failed: 1 error(s), 2 warning(s)
Comment 1 Jürg Billeter 2011-03-27 15:40:37 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 bug 596861 ***