Bug 10624 - dmcs gives C0425 where MS C# doesn't
Summary: dmcs gives C0425 where MS C# doesn't
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2013-02-24 15:03 UTC by Kolja Dummann
Modified: 2013-02-25 02:56 UTC (History)
1 user (show)

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

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 Kolja Dummann 2013-02-24 15:03:33 UTC
I tried to compile this piece of code:

using System;
using System.Collections.Generic;

namespace test
	public interface IEntity<T>
		T Id {get; set;}
	public interface IRepository<TId>
		IEnumerable<T> Get<T> () where T : IEntity<TId>;

	public class Repository : test.IRepository<int>
		public IEnumerable<T> Get<T> () where T : IEntity<int>
			throw new NotImplementedException();

Which gave me an:

Compilation failed: 1 error(s), 0 warnings

/home/kolja/test/test/Main.cs(17,39): error CS0425: The constraints for type parameter `T' of method `test.Repository.Get<T>()' must match the constraints for type parameter `T' of interface method `test.IRepository<int>.Get<T>()'. Consider using an explicit interface implementation instead
/home/kolja/test/test/Main.cs(12,32): (Location of the symbol related to previous error)

kolja@UnimatrixZero:/build/net$ dmcs --version
Mono C# compiler version

Which compiles fine on Visual Studio.
Comment 1 Marek Safar 2013-02-25 02:56:33 UTC
Already fixed in Mono 3.0