GNOME Bugzilla – Bug 559278
Temporary variables in switch condition aren't declared in C code.
Last modified: 2008-12-18 00:03:00 UTC
Please describe the problem: Temporary variables created in the condition of a switch statement appear not to be getting predeclared in the C code. Steps to reproduce: using GLib; namespace Blah { public class Foo: GLib.Object { public int blah{ get{ return 1; } } public static int main() { return 0; }// main public static void foo() { switch(new Foo().blah) { case 1: stdout.printf("Got 1\n"); break; default: stdout.printf("Default\n"); break; } } }// Foo }// Blah Actual results: blah.c: In function ‘blah_foo_foo’: blah.c:31: error: ‘_tmp1’ undeclared (first use in this function) blah.c:31: error: (Each undeclared identifier is reported only once blah.c:31: error: for each function it appears in.) blah.c:31: error: ‘_tmp0’ undeclared (first use in this function) Expected results: Successful compilation. Does this happen every time? Yes. Other information:
2008-12-18 Jürg Billeter <j@bitron.ch> * gobject/valaccodecontrolflowmodule.vala: Fix temporary variable handling in switch expressions, fixes bug 559278 Fixed in r2209.