[Mono-bugs] [Bug 413633] New: Complex generic inheritance fails to find members

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 31 11:22:50 EDT 2008


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


           Summary: Complex generic inheritance fails to find members
           Product: Mono: Compilers
           Version: SVN
          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:


Steps to reproduce the problem:
Try to compile this code:

public abstract class NonGenericBase
{
    public abstract int this[int i] { get; }
}

public abstract class GenericBase<T> : NonGenericBase
    where T : GenericBase<T>
{
    T Instance { get { return default(T); } }

    public void Foo()
    {
        int i = Instance[10];
    }
}

public class Derived : GenericBase<Derived>
{
    public override int this[int i] { get { return i; } }
}

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


Actual Results:

Test2.cs(13,17): error CS0021: Cannot apply indexing with [] to an expression
of type `T'


Expected Results:
Compile without warning.


How often does this happen? 
Every time.


Additional Information:
Compiles on .NET 3.5.
Moving the abstract indexer to GenericBase cures the problem (but that's not
appropriate for my real code).


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