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
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2017-01-13 13:36 UTC by Josh Peterson
Modified: 2017-01-13 19:14 UTC (History)
1 user (show)

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

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

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.