Project
ReSharper
Priority
Critical
Type
Bug
Fix versions
5.0
State
Fixed
Assignee
Olga Lobacheva
Subsystem
PSI
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Vladimir Reshetnikov
    3 years ago (04 Feb 2009 02:10)
  • Updated by   Olga Lobacheva
    18 months ago (14 Jul 2010 18:54)
  • Jira: RSRP-94239
    (history, comments)
 
RSRP-94239 error CS0029: Cannot implicitly convert type 'void' to 'int'
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
using System;

class A
{
    static void Main()
    {
        int x = new C().Foo(1, 1); // error CS0029: Cannot implicitly convert type 'void' to 'int'
    }
}

abstract class B<S>
{
    public abstract int Foo<T>(T x, S y);
    public void Foo<T>(int x, T y){}
}
class C : B<int>
{
    public override int Foo<T>(T x, int y)
    {
        throw new NotImplementedException();
    }
}


Overload resolution is wrong.
Comments (1)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Olga Lobacheva
  Olga Lobacheva
06 Feb 2009 19:07
3 years ago

class P
{
  public void Foo(int o){}
  public virtual string Foo(object o)
  {
    return null;
  }
}

class P1: P
{
  public override string Foo(object o)
  {
    return null;
  }
}

class K
{
  public void Usage()
  {
    string foo = new P1().Foo(1);
  }
}