Project
ReSharper
Priority
Show-stopper
Type
Bug
Fix versions
2.5.1, 3.0
State
Fixed
Assignee
Andrey Simanovsky
Subsystem
Code Insight
Affected versions
No Affected versions
Fixed in build
No Fixed in build
  • Created by   Vladimir Reshetnikov
    5 years ago (12 Oct 2006 15:14)
  • Updated by   Vladimir Reshetnikov
    5 years ago (12 Dec 2006 22:02)
  • Jira: RSRP-29747
    (history, comments)
 
RSRP-29747 Explicit implementation of constrained generic method
0
Issue is visible to: All Users
  The issue is visible to the selected user group only
interface IFace<T> 
{
    void Foo<S>() where S : T;
}

class Stuff : IFace<string>
{
  // Alt+Ins, Implement interface member, explicit
}


Result:

interface IFace<T> 
{
    void Foo<S>() where S : T;
}

class Stuff : IFace<string>
{
    void IFace<string>.Foo<S>() where S : string // error CS0460: Constraints for override and explicit interface implementation methods are inherited from the base method, so they cannot be specified directly
    {
        throw new NotImplementedException();
    }
}


Do not insert 'where' clause in explicit implementation.
Also, do not suggest to implement implicitly, if it would produce incorrect constraint (for example, sealed class constraint)

Issue was closed
Comments (0)
 
History
 
Linked Issues (?)
 
TeamCity Changes (0)
 
Issue has no comments