Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
The code analysis rule for "Function never returns" flags this method:
int i = 0;
yield return i++;
I don't think it should flag methods that use "yield return". It's not uncommon to write methods with that kind of pattern. It's not actually a hang unless you try to enumerate all values (using something like ToList()).
I have checked this issue but I am unable to reproduce this issue.
Steps I followed:
1. Create a console project.
2. Write the following method in Main class
3. Build the project.
When I build the project I am not getting the "Function never returns" warning. However, when I hover cursor over the AllInts() method I am getting following error message:
Please let me know if I am missing something?
Mac OS X 10.9.5
Xamarin Studio 5.5 (build 221)
Installation UUID: 6ea47b0d-1852-4aaf-808d-373ff0a5002b
Mono 3.10.0 ((detached/ac51002)
GTK+ 2.24.23 (Raleigh theme)
Package version: 310000016
=== Build Information ===
Release ID: 505000221
Git revision: 5593ae2759cc72daba96ad1a7bcf2b584a26e1cc
Build date: 2014-09-25 17:56:39-04
Xamarin addins: 9c609d1ca384863aafef4336d94b4b55d059d4ff
This is a code analysis issue, not a build error. Notice the yellowish underline on the AllInts method name. That's the issue. If you hover over that it will tell you that the method never returns, which isn't accurate.
I can reproduce the reported behavior as mentioned in comment 1. I am also getting a warning message on AllInts() method which is using "yield return". I’ll need confirmation from the developer if this is a bug. Leaving as NEW for now.
However, if I uncheck the "Enable source analysis of open file" option from "Xamarin Studio => Preferences... => Source Analysis ( Under Text Editor)" I am not getting any warning message when I hover over the "AllInts()" method.
That quick fix is no longer part of MonoDevelop.