-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaceColliding.cs
More file actions
41 lines (35 loc) · 1.02 KB
/
Copy pathInterfaceColliding.cs
File metadata and controls
41 lines (35 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
namespace TestNamespace
{
public interface I1 {
int Get(); }
namespace Inner
{
public interface I1 {
int Get(); }
}
public static class TestClass {
public interface I1 {
int Get(); }
public class Implementer : TestNamespace.I1, TestNamespace.TestClass.I1, TestNamespace.Inner.I1
{
int TestNamespace.I1.Get() {
return 0;
}
int TestNamespace.TestClass.I1.Get() {
return 1;
}
int TestNamespace.Inner.I1.Get() {
return 2;
}
}
}
}
public static class Program {
public static void Main (string[] args) {
var implementer = new TestNamespace.TestClass.Implementer();
Console.WriteLine(((TestNamespace.I1)implementer).Get());
Console.WriteLine(((TestNamespace.TestClass.I1)implementer).Get());
Console.WriteLine(((TestNamespace.Inner.I1)implementer).Get());
}
}