Bugzilla – Bug 325291
[Flow-analysis] Missing CS1622 for return from iterator
Last modified: 2008-07-17 14:11:38 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".
Fixed in SVN.