This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 8232 - wrong CS0314 error from compiler on generic method override
: wrong CS0314 error from compiler on generic method override
Status: RESOLVED FIXED
Product: Compilers
Classification: Mono
Component: C#
: unspecified
: PC Linux
: --- normal
: ---
Assigned To: Marek Safar
:
:
:
:
  Show dependency treegraph
 
Reported: 2012-11-05 17:32 EST by Giacomo Tesio
Modified: 2012-11-10 09:38 EST (History)
2 users (show)

See Also:
Tags:
Test Case URL:
External Submit: ---


Attachments
A sample code that reproduce the bug (764 bytes, text/x-csharp)
2012-11-05 17:32 EST, Giacomo Tesio
Details

Description Giacomo Tesio 2012-11-05 17:32:35 EST
Created attachment 2870 [details]
A sample code that reproduce the bug

In the attached sample the compiler produce an error like this:

Test.cs(27,27): Error CS0314: The type `MoreSpecialized' cannot be used as type
parameter `Specialization' in the generic type or method
`Test.A<Abstraction>.For<Specialization>()'. There is no boxing or type
parameter conversion from `MoreSpecialized' to `Abstraction' (CS0314)

This is wrong becouse of the constraints in A.For and in B declaration.
Comment 1 Giacomo Tesio 2012-11-07 13:48:55 EST
I'm running the master branch from github.
Comment 2 Marek Safar 2012-11-10 09:38:23 EST
Fixed in master

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