GNOME Bugzilla – Bug 584575
Testing out string variable always succeeds
Last modified: 2010-01-29 21:11:22 UTC
Please describe the problem: When an out string variable is passed to a function, testing if it's null always succeeds. It's because the generated code checks if what's being pointed to is null (which is set when the function begins) rather than the pointer itself. Steps to reproduce: void func1(out string? s) { if (s != null) s = "bar"; } void main() { string foo; func1(out foo); stdout.printf("%s\n", foo); } This code never prints "bar", which I expect it to. Removing the null test in func1 will make this work. 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 bug 591673 ***