Bug 13324 - CS0314 with partial classes and constraints (REGRESSION) - alternative test
Summary: CS0314 with partial classes and constraints (REGRESSION) - alternative test
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-07-18 14:54 UTC by Ole Hyldahl Tolshave
Modified: 2013-07-20 04:51 UTC (History)
1 user (show)

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


Attachments
Zip-file with 5 small C# files. (1.07 KB, application/x-zip-compressed)
2013-07-18 14:54 UTC, Ole Hyldahl Tolshave
Details


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:
Status:
RESOLVED FIXED

Description Ole Hyldahl Tolshave 2013-07-18 14:54:08 UTC
Created attachment 4374 [details]
Zip-file with 5 small C# files.

The fix for bug 13289 did indeed work. However while the commit 37bad99b16e0d53eda63fca546f68840c76355ad fixed the test case from bug 13289, it still cannot compile my code base (mono 2.10.9 can).

I have created another test case (attached) that demonstrates the problem. It might not be 100% minimal but it is probably close.

HOW TO REPRODUCE?
1. Unpack the contents of the zip-file.
2. Execute "mcs A.cs B.cs C.cs I.cs Test.cs /out:Test.exe"

WHAT HAPPENS?
mcs terminates with these errors:
A.cs(3,23): error CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `B<T>'. There is no boxing or type parameter conversion from `T' to `Ibase'
A.cs(1,24): (Location of the symbol related to previous error)
C.cs(9,34): error CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `B<T>'. There is no boxing or type parameter conversion from `T' to `Ibase'
A.cs(1,24): (Location of the symbol related to previous error)
C.cs(11,37): error CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `B<T>'. There is no boxing or type parameter conversion from `T' to `Ibase'
A.cs(1,24): (Location of the symbol related to previous error)
C.cs(13,34): error CS0314: The type `T' cannot be used as type parameter `T' in the generic type or method `B<T>'. There is no boxing or type parameter conversion from `T' to `Ibase'
A.cs(1,24): (Location of the symbol related to previous error)
Compilation failed: 4 error(s), 0 warnings

WHAT SHOULD HAVE HAPPENED?
mcs should have compiled without errors and the final executable should just print "Done" when executed.

NOTICE! As in bug 13289 the order of the input files makes a difference. IE this command makes mcs compile just fine:
(Note that A.cs and B.cs have been swapped)
mcs B.cs A.cs C.cs I.cs Test.cs /out:Test.cs
Comment 1 Marek Safar 2013-07-20 03:19:53 UTC
Fixed in master
Comment 2 Ole Hyldahl Tolshave 2013-07-20 04:51:56 UTC
The test case is indeed working now and so is my "real" code base. Thanks a alot for fast work :-).