[Mono-bugs] [Bug 365314] New: Type parameters are not restricted to identifiers

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Feb 27 13:28:21 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=365314


           Summary: Type parameters are not restricted to identifiers
           Product: Mono: Compilers
           Version: 1.9.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jpryor at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


According to the standard (and .NET CSC.EXE), type parameters need to be
identifiers.  gmcs does not require this.

To duplicate, compile the following code:

        // nested generics?
        interface IFoo<T> {
        }

        public class Bar {
                public IFoo<T> GetItemCommand<IFoo<T>>()
                {
                        return default(IFoo<T>);
                }
        }

        class Test {
                public static void Main ()
                {
                }
        }

Actual Results:

No error.

Expected results:

p.cs(8,32): error CS0081: Type parameter declaration must be an identifier not
a type
p.cs(8,14): error CS0246: The type or namespace name 'T' could not be found
(are you missing a using directive or an assembly reference?)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list