-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathLocalVar.cs
42 lines (37 loc) · 1.48 KB
/
LocalVar.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
using System;
using System.Diagnostics.CodeAnalysis;
namespace InlineIL;
/// <summary>
/// Represents a local variable declaration, for use with <see cref="IL.DeclareLocals(InlineIL.LocalVar[])"/>.
/// </summary>
[SuppressMessage("ReSharper", "UnusedParameter.Local")]
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
[SuppressMessage("ReSharper", "MemberCanBeMadeStatic.Global")]
public sealed class LocalVar
{
/// <summary>
/// Constructs a named local variable, which can be accessed by name or by index.
/// </summary>
/// <param name="localName">The local variable name.</param>
/// <param name="type">The local variable type.</param>
public LocalVar(string localName, TypeRef type)
=> IL.Throw();
/// <summary>
/// Constructs an anonymous local variable, which can be accessed by index.
/// </summary>
/// <param name="type">The local variable type.</param>
public LocalVar(TypeRef type)
=> IL.Throw();
/// <summary>
/// Converts a <see cref="Type"/> to a <see cref="LocalVar"/>.
/// </summary>
/// <param name="type">The local variable type.</param>
public static implicit operator LocalVar(Type type)
=> throw IL.Throw();
/// <summary>
/// Makes the object referred to by the local as pinned in memory, which prevents the garbage collector from moving it.
/// </summary>
/// <returns>The local variable declaration.</returns>
public LocalVar Pinned()
=> throw IL.Throw();
}