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
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.
Created attachment 4356 [details]
ZIP-archive containing 3 C#-files.
I have a quite complictaed class system with a lot of partial classes and generic parameter constraints.
The library fails to compile with mono 3.1.2, but compiles just fine on 2.10.9 (and Visual Studio 2012).
I have isolated the attached test case with consists only 3 files.
How to reproduce:
Unzip the attached zip file and build with:
$ mcs BD.cs Program.cs GPD.cs /out:Test.exe
What happens (on mono 3.1.2):
MCS fails with this error:
GPD.cs(5,30): error CS0314: The type `T2' cannot be used as type parameter `T' in the generic type or method `PC<T>'. There is no boxing or type parameter conversion from `T2' to `PD'
Program.cs(10,17): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings
What should have happened (and does happen with 2.10.9);
The program builds and when executed simply prints "Done".
When changing the build command to (order of input files changed):
mcs Program.cs BD.cs GPD.cs /out:Test.exe
then 3.1.2 builds fine. I tried changing the order of the input files on 2.10.9, but 2.10.9 appears to be working with any order.
Fixed in master.
Nice test case, thanks for the effort.
Thank you for your swift response. I can confirm that the fix does indeed work for the attached test case.
However, I have created a new bug 13324 that is probably related.