[Mono-bugs] [Bug 346998] New: type inference bug prevents compilation of nhibernate

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Dec 7 16:15:58 EST 2007


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


           Summary: type inference bug prevents compilation of nhibernate
           Product: Mono: Compilers
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: jan.oravec at 6com.sk
         QAContact: mono-bugs at ximian.com
          Found By: ---


The following code does not compile -- the compiler tries to use type inference
on generic version of method B.Foo<T> () from method B.Goo () instead of using
non-generic method B.Foo (). The problem seems to happen only when the methods
are overriden.


using System.Collections;
using System.Collections.Generic;

class A
{
  public virtual IList Foo (string s)
  {
    return null;
  }

  public virtual IList<T> Foo<T> (string s)
  {
    return null;
  }
}

class B : A
{
  public IList Goo (string s)
  {
    return Foo (s);
  }

  public override IList Foo (string s)
  {
    return null;
  }

  public override IList<T> Foo<T> (string s)
  {
    return null;
  }
}


class C
{
  public static int Main ()
  {
    new B ().Goo ("q");

    return 0;
  }
}


Error message:

foo.cs(21,5): error CS0266: Cannot implicitly convert type
`System.Collections.Generic.IList<T>' to `System.Collections.IList'. An
explicit conversion exists (are you missing a cast?)
Compilation failed: 1 error(s), 0 warnings

Mono is compiled from SVN rev.90461. I have not seen any related changes in
compiler since that revision.

I think this is critical as many other projects may be also affected.


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