Bug 44402 - Array doesn't implement non-generic IEnumerable
Summary: Array doesn't implement non-generic IEnumerable
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: 4.6.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: C8SR0
Assignee: Marek Safar
: 43838 44323 44510 ()
Depends on:
Reported: 2016-09-16 02:04 UTC by Jon Hughes
Modified: 2016-09-20 07:49 UTC (History)
8 users (show)

Tags: BZRC8B4_C7SR1S1
Is this bug a regression?: Yes
Last known good build: Cycle 7 SR 1

repro project (296.56 KB, application/zip)
2016-09-16 02:04 UTC, Jon Hughes

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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 GitHub or Developer Community 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.

Related Links:

Description Jon Hughes 2016-09-16 02:04:41 UTC
Created attachment 17526 [details]
repro project

# Steps to reproduce

Compile attached project.

# Expected behaviour

It compiles

# Actual behaviour

Compiler error: Error CS0029: Cannot implicitly convert type `int[]' to `System.Collections.IEnumerable'

# Supplemental information

Seems to work OK if you change any of the following
* Remove nuget package Rx-Linq
* Change PCL profile (The attached project is profile 78, it compiled for me on 136)
* Change project type to native class library (worked for me in an iOS class library, which was relevant to the project where I discovered the issue)
* Use Visual Studio 2015

Reproduces on 2 Macs in our office.

# Test Environment

=== Xamarin Studio Enterprise ===

Version 6.1 (build 5441)
Installation UUID: 55efec84-8d44-4ce0-824d-d80bea1a9ee2
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245

=== NuGet ===


=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.iOS ===

Version: (Visual Studio Enterprise)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

=== Xamarin.Mac ===

Version: (Visual Studio Enterprise)

=== Xamarin.Android ===

Version: (Visual Studio Enterprise)
Android SDK: /Users/jonhughes/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Build Information ===

Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.12.0
Darwin <snip> 16.0.0 Darwin Kernel Version 16.0.0
    Mon Aug 29 17:56:20 PDT 2016
    root:xnu-3789.1.32~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

NuGet Package Management Extensions 0.11.1
Comment 1 Marek Safar 2016-09-16 11:07:46 UTC
*** Bug 44323 has been marked as a duplicate of this bug. ***
Comment 2 Marek Safar 2016-09-16 11:16:20 UTC
Fixed in master/Mono 4.8/Mono 4.6 SR1
Comment 3 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-16 20:38:03 UTC
*** Bug 43838 has been marked as a duplicate of this bug. ***
Comment 4 Nick Berardi 2016-09-18 17:59:56 UTC
Could you provide a link to the patch?
Comment 5 Alexander Köplinger [MSFT] 2016-09-19 10:38:29 UTC
@Nick: https://github.com/mono/mono/commit/0dfef7b3453a1599806b8be04cf42f9b67c2e592
Comment 7 Brendan Zagaeski (Xamarin Team, assistant) 2016-09-19 23:29:45 UTC
If any user wishes to try an unofficial build based on the current Mono 4.6.0 branch rather than downgrading to Mono 4.4.0, the following build is available:


Keep in mind that this specific build has had no formal testing or approval, so please use it at your own risk.

This fix will also be formally included in the next Cycle 8 bug fix Service Release, which is tentatively scheduled for publication later this week (the week of September 19).
Comment 8 Shruti 2016-09-20 07:22:55 UTC
Reproduce Status:

I have checked this issue and successfully able to reproduce it on my end. I have used the builds mentioned in the comment0 and the test project from the bug comment: https://bugzilla.xamarin.com/show_bug.cgi?id=43838#c0 and observed the below error.

Error: MainActivity.cs(31,31): error CS1929: Type `System.Array' does not contain a member `OfType' and the best extension method overload `System.Linq.Enumerable.OfType<TestLinq.MyTestEnum>(this System.Collections.IEnumerable)' requires an instance of type `System.Collections.IEnumerable'

Supplement Info:

Screencast: http://www.screencast.com/t/BGvkXqzJ4q9
Environment Info and IDE Logs: https://gist.github.com/shrutis360/4814064c84cba834e62da4e2e70798fa
Build Output: https://gist.github.com/Shruti360/f2f6a87b4bcb5c902e05e3f1e0454026

Verification Status:

I have verified this issue with latest C8SR0 builds, using the same test project and observe that this issue is fixed. Array successfully implement non-generic IEnumerable. 

Supplement Info:

Screencast: http://www.screencast.com/t/OTkZmknatps
Environment Info and IDE Logs: 
Build Output:  https://gist.github.com/Shruti360/e18ef73c761788d5ca3d59978d2ca14b
Application Output:  https://gist.github.com/Shruti360/af784c0144f036e12b4066a09df579d7

Hence, marking this issue as verified fixed. And please merge the fix into Cycle8.


Comment 9 Marek Safar 2016-09-20 07:49:45 UTC
*** Bug 44510 has been marked as a duplicate of this bug. ***