Bugzilla – Bug 311892
mcs incorrect CS0177 with out structs
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by japj@xs4all.nl 2003-01-05 15:39:22 MST ---- Please fill in this template when reporting a bug, unless you know what you are doing. Description of Problem: Steps to reproduce the problem: 1. Try to compile the following program with mcs: class Test1 { public struct STest { public int x; } public virtual bool LookupProperty(int var1, out STest var2) { if (var1 == 0) { var2.x = 10; return true; } else { var2.x = var1; return false; } } public static void Main() { } } 2. 3. Actual Results: japj@debian:~/mono$ mcs test.cs test.cs(11) error CS0177: The out parameter `var2' must be assigned before control leave the current method. Compilation failed: 1 error(s), 0 warnings Expected Results: compilation to go ok How often does this happen? Always Additional Information: I found this while trying to get janet compile with MCS ---- Additional Comments From miguel@ximian.com 2003-01-07 16:15:35 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO36154 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"