the Fiddler's picture

Demo fails to compile on Mono 2.4.3 (bogus generic constraint mismatch)

Project:The Open Toolkit demo
Version:1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:fixed
Description

Mono 2.4.3 fails to compile the following code:

interface Foo { void Bar<T>() where T : struct; }
class Baz { public void Bar<T>() where T: struct { } }

It complains that the generic constraint of the implementation does not match the constraint of the interface. This issue is reported as fixed on Mono 2.6.

As a temporary workaround, I have disabled the "struct" constraint when compiling on Mono. The workaround should be removed once Mono 2.6 achieves critical mass.