Bug 311892 (MONO36321) - mcs incorrect CS0177 with out structs
Summary: mcs incorrect CS0177 with out structs
Status: RESOLVED MOVED
Alias: MONO36321
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-05 22:39 UTC by Jeroen Janssen
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:05:28 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"