Skip to content

Commit 40b41a8

Browse files
ds5678SamboyCoding
authored andcommitted
Class for concrete generic fields
1 parent b7eb4d8 commit 40b41a8

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System.Reflection;
2+
using Cpp2IL.Core.Utils;
3+
4+
namespace Cpp2IL.Core.Model.Contexts;
5+
6+
public class ConcreteGenericFieldAnalysisContext : FieldAnalysisContext
7+
{
8+
public FieldAnalysisContext BaseFieldContext { get; }
9+
public override FieldAttributes Attributes => BaseFieldContext.Attributes;
10+
public override TypeAnalysisContext FieldTypeContext { get; }
11+
public override string DefaultName => BaseFieldContext.DefaultName;
12+
public override string? OverrideName { get => BaseFieldContext.OverrideName; set => BaseFieldContext.OverrideName = value; }
13+
14+
public ConcreteGenericFieldAnalysisContext(FieldAnalysisContext baseField, GenericInstanceTypeAnalysisContext genericInstanceType)
15+
: base(null, genericInstanceType)
16+
{
17+
BaseFieldContext = baseField;
18+
FieldTypeContext = GenericInstantiation.Instantiate(baseField.FieldTypeContext, genericInstanceType.GenericArguments, []);
19+
}
20+
}

0 commit comments

Comments
 (0)