© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
6 replies
cap5lut

✅ Make method implemented in interface accessible from implementing type

i have an interface
interface ICL
{
  public IEnumerable<ICLPlatform> GetPlatforms()
  {
    // code
  }
}
interface ICL
{
  public IEnumerable<ICLPlatform> GetPlatforms()
  {
    // code
  }
}
and an implementing struct
struct CLAdapter : ICL
{
}
struct CLAdapter : ICL
{
}

now
GetPlatforms()
GetPlatforms()
isnt reachable via
new CLAdapter().GetPlatforms()
new CLAdapter().GetPlatforms()
, how can i make that accessible?

i tried implementing it in the adapter by simply casting
this
this
to
ICL
ICL
, but then i run into stack overflows
    /// <inheritdoc/>
    public IEnumerable<ICLPlatform> GetPlatforms()
    {
        return ((ICL)this).GetPlatforms();
    }
    /// <inheritdoc/>
    public IEnumerable<ICLPlatform> GetPlatforms()
    {
        return ((ICL)this).GetPlatforms();
    }
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Invoke explicitly implemented static interface method
C#CC# / help
12mo ago
Interface implementing generic parameters
C#CC# / help
2y ago
interface vs extension method vs method in class
C#CC# / help
3y ago
Class showing Interface member not implemented
C#CC# / help
3y ago