This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 51506 - C# compiler fails for constrained generics with yield return
Summary: C# compiler fails for constrained generics with yield return
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2017-01-13 13:36 UTC by Josh Peterson
Modified: 2017-01-13 19:14 UTC (History)
1 user (show)

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


Attachments
C# file to demonstrate the bug (1.21 KB, text/plain)
2017-01-13 13:36 UTC, Josh Peterson
Details

Description Josh Peterson 2017-01-13 13:36:36 UTC
Created attachment 19322 [details]
C# file to demonstrate the bug

The attached C# code fails to compile with this error:

Program.cs(16,2): error CS0314: The type `TVector' cannot be used as type parameter `T' in the generic type or method `Program.BoundingBoxN<T>'. There is no boxing or type parameter conversion from `TVector' to `Program.IVector<TVector>'
D:\scratch\ScratchCSharpProject\ScratchCSharpProject\Program.cs(58,29): (Location of the symbol related to previous error)
Compilation failed: 1 error(s), 0 warnings

The same code compiles with the Microsoft C# Compiler.

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