forked from ltrzesniewski/InlineIL.Fody
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypeRef.cs
123 lines (108 loc) · 5.26 KB
/
TypeRef.cs
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System;
using System.Diagnostics.CodeAnalysis;
namespace InlineIL
{
/// <summary>
/// Represents a type reference. This class is implicitly convertible from <see cref="System.Type"/>.
/// </summary>
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
[SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Global")]
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
[SuppressMessage("ReSharper", "UnusedTypeParameter")]
public sealed class TypeRef
{
/// <summary>
/// Returns the core library name, for use with <see cref="TypeRef(string, string)"/>
/// </summary>
public static string CoreLibrary
=> throw IL.Throw();
/// <summary>
/// Generic parameters of the declaring type, for overload resolution in <see cref="MethodRef"/>.
/// Generic parameters of a nested type come after generic parameters of its enclosing type.
/// </summary>
public static GenericParameters TypeGenericParameters
=> throw IL.Throw();
/// <summary>
/// Generic parameters of the method, for overload resolution in <see cref="MethodRef"/>.
/// </summary>
public static GenericParameters MethodGenericParameters
=> throw IL.Throw();
/// <summary>
/// Constructs a type reference from a <see cref="System.Type"/>.
/// </summary>
/// <param name="type">The type to reference.</param>
public static TypeRef Type(Type type)
=> throw IL.Throw();
/// <summary>
/// Constructs a type reference from a <see cref="System.Type"/>.
/// </summary>
/// <typeparam name="T">The type to reference.</typeparam>
public static TypeRef Type<T>()
=> throw IL.Throw();
/// <summary>
/// Constructs a type reference from a <see cref="System.Type"/>.
/// </summary>
/// <param name="type">The type to reference.</param>
public TypeRef(Type type)
=> IL.Throw();
/// <summary>
/// Constructs a type reference.
/// </summary>
/// <param name="assemblyName">The assembly name containing the type. This assembly should be referenced by the weaved assembly.</param>
/// <param name="typeName">The full runtime type name, as returned by <see cref="System.Type.FullName"/>.</param>
public TypeRef(string assemblyName, string typeName)
=> IL.Throw();
/// <summary>
/// Converts a <see cref="System.Type"/> to a <see cref="TypeRef"/>.
/// </summary>
/// <param name="type">The type to reference.</param>
public static implicit operator TypeRef(Type type)
=> throw IL.Throw();
/// <summary>
/// Returns a type that represents a pointer to the current type.
/// </summary>
/// <returns>A <see cref="TypeRef"/> that represents a pointer to the current type.</returns>
public TypeRef MakePointerType()
=> throw IL.Throw();
/// <summary>
/// Returns a type that represents a reference to the current type.
/// </summary>
/// <returns>A <see cref="TypeRef"/> that represents a reference to the current type.</returns>
public TypeRef MakeByRefType()
=> throw IL.Throw();
/// <summary>
/// Returns a type that represents a one-dimensional array of the current type.
/// </summary>
/// <returns>A <see cref="TypeRef"/> that represents a one-dimensional array of the current type.</returns>
public TypeRef MakeArrayType()
=> throw IL.Throw();
/// <summary>
/// Returns a type that represents an array of the current type, with the specified number of dimensions.
/// </summary>
/// <param name="rank">The number of dimensions for the array.</param>
/// <returns>A <see cref="TypeRef"/> that represents an array of the current type.</returns>
public TypeRef MakeArrayType(int rank)
=> throw IL.Throw();
/// <summary>
/// Returns a type that represents a constructed generic type.
/// </summary>
/// <param name="typeArguments">An array of type references to be substituted for the type parameters of the current generic type.</param>
/// <returns>A <see cref="TypeRef"/> that represents a constructed generic type.</returns>
public TypeRef MakeGenericType(params TypeRef[] typeArguments)
=> throw IL.Throw();
/// <summary>
/// Returns a type with an applied custom optional modifier (<c>modopt</c>).
/// </summary>
/// <param name="modifierType">The custom modifier type.</param>
/// <returns>A <see cref="TypeRef"/> with the custom modifier applied.</returns>
public TypeRef WithOptionalModifier(TypeRef modifierType)
=> throw IL.Throw();
/// <summary>
/// Returns a type with an applied custom required modifier (<c>modreq</c>).
/// </summary>
/// <param name="modifierType">The custom modifier type.</param>
/// <returns>A <see cref="TypeRef"/> with the custom modifier applied.</returns>
public TypeRef WithRequiredModifier(TypeRef modifierType)
=> throw IL.Throw();
}
}