Bug 325291 (MONO82624) - [Flow-analysis] Missing CS1622 for return from iterator
Summary: [Flow-analysis] Missing CS1622 for return from iterator
Status: RESOLVED FIXED
Alias: MONO82624
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Marek Safar
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-29 16:59 UTC by Marek Safar
Modified: 2008-07-17 14:11 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 20:50:49 UTC


---- Reported by marek.safar@seznam.cz 2007-08-29 09:59:01 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:

using System.Collections;

public class C
{
		internal static IEnumerable PrivateBinPath
		{
			get {
				string a = "a";
				if (a == null)
					return false;
				yield return a;
			}
		}
	
}

Actual Results:

No error.

Expected Results:

?.cs(11,13): error CS0029: Cannot implicitly convert type `bool' to       
 `System.Collections.IEnumerable'
?.cs(11,6): error CS1622: Cannot return a value from an iterator. Use the
yield return statement to return a value, or yield break to end the iteration

How often does this happen? 


Additional Information:


Unknown operating system unknown. Setting to default OS "Other".

Comment 2 Marek Safar 2008-07-17 14:11:38 UTC
Fixed in SVN.