dotnet / dotnet/csharpstandard

Qualified interface member name with "using"

Open
#979 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
815
Forks
99
Avg merge
1d 14h
Merged PRs (30d)
16

Description

**Describe the bug**

In draft-v8, §18.6.2 (Explicit interface member implementations) specifies:

> An explicit interface member implementation is a method, property, event, or indexer declaration that references a qualified interface member name.

It is not clear whether the *qualified interface member name* can refer to the interface by using an alias defined in a `using` directive. §18.5 (Qualified interface member names) says:

> The qualified name of an interface member consists of the name of the interface in which the member is declared, followed by a dot, followed by the name of the member.

An alias doesn't seem to be "the name" of the interface.

**Example**

```csharp
using IAlias1 = IActual;
using IAlias2 = IActual;

public interface IActual {
void M();
}

public class C : IAlias1 {
void IAlias2.M() {}
}
```

**Expected behavior**

Explicitly allow this.

**Additional context**

None.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.