[Mono-bugs] [Bug 358566] New: System.CodeDom: Adding items to CodeTypeReference. TypeArguments doesn't update BaseType

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Feb 4 11:00:57 EST 2008


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


           Summary: System.CodeDom:  Adding items to
                    CodeTypeReference.TypeArguments doesn't update BaseType
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.Core
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: stefan at fogcreek.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


The following code creates an incorrect CodeTypeReference on Mono but not on
net.

private CodeTypeReference GetTypeRef()
{
    CodeTypeReference result = new CodeTypeReference();
    result.BaseType = "System.Nullable";

    result.TypeArguments.Add(new CodeTypeReference(typeof(int)));

    // <WORKAROUND>
    //if (result.TypeArguments.Count > 0 && result.BaseType.IndexOf('`') == -1)
    //    result.BaseType += "`" + result.TypeArguments.Count;
    // </WORKAROUND>

    return result;
}

On .net when the TypeArguments member is modified, the BaseType is too. This
can be worked around by uncommenting the workaround.

Without the workaround, System.Nullable is generated in the source code instead
of System.Nullable<int>.


-- 
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