[Mono-bugs] [Bug 413418] New: Type conversion failure when using namespace alias and generic type for variable declaration

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Jul 30 18:21:51 EDT 2008


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


           Summary: Type conversion failure when using namespace alias and
                    generic type for variable declaration
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: skeet at pobox.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Description of Problem:

Compiler has trouble with namespace aliases when generic types are involved.

Steps to reproduce the problem:
1. Try to compile the following code:

using scg = global::System.Collections.Generic;
using System.Collections.ObjectModel;
public class Test
{
    scg::IList<string> x = new ReadOnlyCollection<string>(null);

    static void Main(){} // Just to make compilation easy
}

Actual Results:
Test.cs(6,28): error CS0266: Cannot implicitly convert type
`System.Collections.
ObjectModel.ReadOnlyCollection<string>' to
`System.Collections.Generic.IList<T>'
 An explicit conversion exists (are you missing a cast?)
Compilation failed: 1 error(s), 0 warnings

Expected Results:
Successful compilation.

How often does this happen? 
Every time.

Additional Information:


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