Re: abstract class 'does not implement interface member ...'
- From: "Jon Skeet [C# MVP]" <skeet@xxxxxxxxx>
- Date: Tue, 19 Jun 2007 02:52:16 -0700
On Jun 19, 10:48 am, "Christof Nordiek" <c...@xxxxxxxxx> wrote:
However, that wouldn't solve your problem here - because interface
members are themselves implicitly public, so all the implementations
have to be public. It's very odd that the interface being internal
doesn't make all its members internal too.
If the interface is public, all it's implemantations have to be public. But
if the interface is internal, the implementation of it's members remain
internal if they are implemented implicitly.
No they don't - they have to be declared public:
using System;
internal interface IFoo
{
void Bar();
}
class Test : IFoo
{
static void Main()
{
}
internal void Bar()
{
}
}
fails to compile with the error:
Test.cs(8,7): error CS0536: 'Test' does not implement interface member
'IFoo.Bar()'. 'Test.Bar()' is either static, not public, or
has the
wrong return type.
You *have* to make the method public in order to implement the
interface implicitly.
At least, that's as far as I can see - could you give an example of
what you mean?
Jon
.
- Follow-Ups:
- Re: abstract class 'does not implement interface member ...'
- From: Christof Nordiek
- Re: abstract class 'does not implement interface member ...'
- References:
- abstract class 'does not implement interface member ...'
- From: Ben Voigt [C++ MVP]
- Re: abstract class 'does not implement interface member ...'
- From: Nicholas Paldino [.NET/C# MVP]
- Re: abstract class 'does not implement interface member ...'
- From: Ben Voigt [C++ MVP]
- Re: abstract class 'does not implement interface member ...'
- From: Nicholas Paldino [.NET/C# MVP]
- Re: abstract class 'does not implement interface member ...'
- From: Ben Voigt [C++ MVP]
- Re: abstract class 'does not implement interface member ...'
- From: Jon Skeet [C# MVP]
- Re: abstract class 'does not implement interface member ...'
- From: Christof Nordiek
- abstract class 'does not implement interface member ...'
- Prev by Date: Re: abstract class 'does not implement interface member ...'
- Next by Date: Re: Creating printable forms - best methods?
- Previous by thread: Re: abstract class 'does not implement interface member ...'
- Next by thread: Re: abstract class 'does not implement interface member ...'
- Index(es):
Relevant Pages
|