Bug 317128 (MONO72326) - [GMCS] Error CS0453 reported on valid code
Summary: [GMCS] Error CS0453 reported on valid code
Status: RESOLVED FIXED
Alias: MONO72326
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 04:39 UTC by mtreiber
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:06:40 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".