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

MethodParameterValue.cs « TrimAnalysis « ILLink.Shared « src - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1084203262a2727cd80dc76f544572552e6945cc (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
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

// This is needed due to NativeAOT which doesn't enable nullable globally yet
#nullable enable


using System.Collections.Generic;
using ILLink.Shared.DataFlow;
using ILLink.Shared.TypeSystemProxy;

namespace ILLink.Shared.TrimAnalysis
{
	sealed partial record MethodParameterValue : ValueWithDynamicallyAccessedMembers
	{
		// _overrideIsThis is needed for backwards compatibility with MakeGenericType/Method https://github.com/dotnet/linker/issues/2428
		private readonly bool _overrideIsThis;

		public ParameterProxy Parameter { get; }

		public override IEnumerable<string> GetDiagnosticArgumentsForAnnotationMismatch ()
			=> Parameter.GetDiagnosticArgumentsForAnnotationMismatch ();

		public override string ToString ()
			=> this.ValueToString (Parameter.Method.Method, DynamicallyAccessedMemberTypes);

		public bool IsThisParameter () => _overrideIsThis || Parameter.IsImplicitThis;

		public override SingleValue DeepCopy () => this; // This value is immutable

		public ParameterIndex Index => Parameter.Index;
	}
}