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

struct-static.cs « tests « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 990dee72a950d58ffab8fd25e56a4ead2aab15e6 (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
using System;
using System.Runtime.CompilerServices;

namespace recursivetype_1238911
{
	public struct DecentStruct1
	{
		public FineStruct2 RadicalValue;
	}

	[Serializable]
	public struct FineStruct2
	{
		public static DecentStruct1 BadValue;
	}

	class Program
	{
		static int Main(string[] args)
		{
			try {
				TestBody();
			} catch (TypeLoadException) {
				return 0;
			}
			return 1;
		}

		[MethodImpl (MethodImplOptions.NoInlining)]
		static void TestBody ()
		{
			Type info = typeof(DecentStruct1);
			TestBody2 (info);
		}

		[MethodImpl (MethodImplOptions.NoInlining)]
		static void TestBody2(Type info)
		{
			FineStruct2 fs = (FineStruct2)info.Assembly.CreateInstance("recursivetype_1238911.FineStruct2");
		}
	}
}