Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-136.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5e1ed6a32a568ff1d727d7553ce49b455fbc4982 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;

namespace Martin {
	public struct A
	{
		public readonly long Data;

		public A (long data)
		{
			this.Data = data;
		}

		public static explicit operator B (A a)
		{
			return new B ((int) a.Data);
		}
	}

	public struct B
	{
		public readonly int Data;

		public B (int data)
		{
			this.Data = data;
		}

		public static implicit operator A (B b)
		{
			return new A (b.Data);
		}
	}

	class X
	{
		public static void Main ()
		{
			B? b = new B (5);
			A? a = b;
			B? c = (B?) a;
			B? d = (Martin.B?) a;
		}
	}
}