summaryrefslogtreecommitdiff
path: root/mcs/errors/cs0266-18.cs
blob: 2318a150deebadb8ed89e1f5fa12c980703e5bcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// CS0266: Cannot implicitly convert type `B' to `I'. An explicit conversion exists (are you missing a cast?)
// Line: 21

interface I { }

class A : I { }

class B
{
	public static explicit operator A (B from)
	{
		return new A ();
	}
}

class App
{
	public static void Main ()
	{
		B b = new B ();
		I i = b;
	}
}