Bug 49755 - SMCS compile results in several CS0455 but compiles fine in Visual Studio.
Summary: SMCS compile results in several CS0455 but compiles fine in Visual Studio.
Status: REOPENED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 4.6.0 (C8)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-12-12 20:11 UTC by josh.mackey
Modified: 2016-12-15 20:28 UTC (History)
4 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Zip containing project that reproduces the issue. (14.74 KB, application/zip)
2016-12-13 21:10 UTC, josh.mackey
Details

Description josh.mackey 2016-12-12 20:11:05 UTC
When compiling in Xamarin Studio on OSX, we get several errors all virtually identical to the below. No such errors appear in Visual Studio on Windows and the files compile fine.

Error CS0455: Type parameter `TSink' inherits conflicting constraints `object' and `MediaSink<TISource,TISourceCollection,TISink,TSink,TFrame,TBuffer,TBufferCollection,TFormat>' (CS0455)

The class is as follows:

    public abstract class MediaBranch<TISource, TISourceCollection, TISink, TISinkCollection, TIElement, TSource, TSink, TPipe, TTrack, TBranch, TFrame, TBuffer, TBufferCollection, TFormat> : IMediaElement
        where TISource : class, IMediaSource<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat>, TIElement
        where TISourceCollection : MediaSourceCollection<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat, TISourceCollection>
        where TISink : class, IMediaSink<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat>, TIElement
        where TISinkCollection : MediaSinkCollection<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat, TISinkCollection>
        where TIElement : IMediaElement
        where TSource : MediaSource<TISource, TISink, TISinkCollection, TSource, TFrame, TBuffer, TBufferCollection, TFormat>, TISource
        where TSink : MediaSink<TISource, TISourceCollection, TISink, TSink, TFrame, TBuffer, TBufferCollection, TFormat>, TISink
        where TPipe : MediaPipe<TISource, TISourceCollection, TISink, TISinkCollection, TPipe, TFrame, TBuffer, TBufferCollection, TFormat>, TISource, TISink
        where TTrack : MediaTrack<TISource, TISourceCollection, TISink, TISinkCollection, TIElement, TSource, TSink, TPipe, TTrack, TBranch, TFrame, TBuffer, TBufferCollection, TFormat>
        where TBranch : MediaBranch<TISource, TISourceCollection, TISink, TISinkCollection, TIElement, TSource, TSink, TPipe, TTrack, TBranch, TFrame, TBuffer, TBufferCollection, TFormat>, TIElement
        where TFrame : MediaFrame<TBuffer, TBufferCollection, TFormat, TFrame>
        where TBuffer : MediaBuffer<TFormat, TBuffer>
        where TBufferCollection : MediaBufferCollection<TBuffer, TBufferCollection, TFormat>
        where TFormat : MediaFormat<TFormat>
    {

MediaSink:

    public abstract class MediaSink<TISource, TISourceCollection, TISink, TSink, TFrame, TBuffer, TBufferCollection, TFormat>
        : MediaSinkBase, IMediaSink<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat>
        where TISource : class, IMediaSource<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat>
        where TISourceCollection : MediaSourceCollection<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat, TISourceCollection>
        where TISink : class, IMediaSink<TISource, TISink, TFrame, TBuffer, TBufferCollection, TFormat>
        where TSink : MediaSink<TISource, TISourceCollection, TISink, TSink, TFrame, TBuffer, TBufferCollection, TFormat>, TISink
        where TFrame : MediaFrame<TBuffer, TBufferCollection, TFormat, TFrame>
        where TBuffer : MediaBuffer<TFormat, TBuffer>
        where TBufferCollection : MediaBufferCollection<TBuffer, TBufferCollection, TFormat>
        where TFormat : MediaFormat<TFormat>
    {
Comment 1 Manuel de la Peña 2016-12-13 11:56:32 UTC
Hello,

Can you please provide a minimum skeleton of the class that fails to compile, please include your full build logs and all version informations.

The easiest way to get exact version information is to use the 
"Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" 
button and copy/paste the version informations (you can use the 
"Copy Information" button).
Comment 2 josh.mackey 2016-12-13 21:10:48 UTC
Created attachment 18876 [details]
Zip containing project that reproduces the issue.
Comment 3 josh.mackey 2016-12-13 21:12:52 UTC
Version information is below but I have found the issue. The zip file contains three .cs files. If you swap the order of them in the .csproj file so that File.cs is first, it will compile just fine. If File.cs is last, then you'll get compiler errors.



=== Xamarin Studio Community ===

Version 6.1.2 (build 44)
Installation UUID: 28b919d7-4cd1-42f1-940b-72355ae822e7
Runtime:
	Mono 4.6.2 (mono-4.6.0-branch/08fd525) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406020007

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.1 (11544)
Build 8B62

=== Xamarin.Mac ===

Version: 2.10.0.113 (Xamarin Studio Community)

=== Xamarin.iOS ===

Version: 10.2.1.5 (Xamarin Studio Community)
Hash: 44931ae
Branch: xcode8.1
Build date: 2016-11-01 20:52:28-0400

=== Xamarin.Android ===

Version: 7.0.2.37 (Xamarin Studio Community)
Android SDK: /Users/josh/Library/Android/sdk
	Supported Android versions:
		4.1 (API level 16)
		4.2 (API level 17)
		5.0 (API level 21)
		6.0 (API level 23)
		7.0 (API level 24)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 25
SDK Build Tools Version: 25

Java SDK: /usr
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 601020044
Git revision: 0ccfcd52b95305ebd5b7eca0d88c1017035910ae
Build date: 2016-10-28 15:12:43-04
Xamarin addins: a39a869d8a78d87bdc6775f696c13a4cc9024501
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.12.1
Darwin Joshs-Macbook-Pro.local 16.1.0 Darwin Kernel Version 16.1.0
    Thu Oct 13 21:26:57 PDT 2016
    root:xnu-3789.21.3~60/RELEASE_X86_64 x86_64
Comment 4 Sebastien Pouliot 2016-12-15 20:28:56 UTC
`smcs` is a script (for compatibility) as XI does not ship compilers anymore.

Note You need to log in before you can comment on or make changes to this bug.