Bugzilla – Bug 317128
[GMCS] Error CS0453 reported on valid code
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by mtreiber@gmail.com 2005-02-07 21:39:41 MST ---- gmcs reports error CS0453 (type 'T' must be a value type ...) when a generic class implements a generic interface where the generic type is limited to a struct. The test code below passes on Visual C# Express but reports the same errors on both gmcs 1.1.3 and 1.1.4.20050204 snapshots. using System; public interface IA<T> where T : struct { } public class B<T> : IA<T> where T:struct { } public class MainClass { public static void Main () {} } compiling with "gmcs -out:test.exe test.cs" produces the following output: test.cs(7) error CS0453: The type `T' must be a value type in order to use it as type parameter `T' in the generic type or method `IA`1<T>'. Compilation failed: 1 error(s), 0 warnings ---- Additional Comments From martin@ximian.com 2005-02-14 23:58:49 MST ---- easy ---- Additional Comments From martin@ximian.com 2005-02-15 00:10:14 MST ---- Fixed. Unknown operating system unknown. Setting to default OS "Other".