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

FieldForInstantiatedType.cs « Common « TypeSystem « Common « tools « coreclr « src - github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fbc456a830639cebe31b4df7ba1ac3f2bb8659b9 (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
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;

using Debug = System.Diagnostics.Debug;

namespace Internal.TypeSystem
{
    public sealed partial class FieldForInstantiatedType : FieldDesc
    {
        private readonly FieldDesc _fieldDef;
        private readonly InstantiatedType _instantiatedType;

        internal FieldForInstantiatedType(FieldDesc fieldDef, InstantiatedType instantiatedType)
        {
            Debug.Assert(fieldDef.GetTypicalFieldDefinition() == fieldDef);
            _fieldDef = fieldDef;
            _instantiatedType = instantiatedType;
        }

        public override TypeSystemContext Context
        {
            get
            {
                return _fieldDef.Context;
            }
        }

        public override DefType OwningType
        {
            get
            {
                return _instantiatedType;
            }
        }

        public override string Name
        {
            get
            {
                return _fieldDef.Name;
            }
        }

        public override TypeDesc FieldType
        {
            get
            {
                return _fieldDef.FieldType.InstantiateSignature(_instantiatedType.Instantiation, new Instantiation());
            }
        }

        public override EmbeddedSignatureData[] GetEmbeddedSignatureData()
        {
            return _fieldDef.GetEmbeddedSignatureData();
        }

        public override bool IsStatic
        {
            get
            {
                return _fieldDef.IsStatic;
            }
        }

        public override bool IsInitOnly
        {
            get
            {
                return _fieldDef.IsInitOnly;
            }
        }

        public override bool IsThreadStatic
        {
            get
            {
                return _fieldDef.IsThreadStatic;
            }
        }

        public override bool HasRva
        {
            get
            {
                return _fieldDef.HasRva;
            }
        }

        public override bool IsLiteral
        {
            get
            {
                return _fieldDef.IsLiteral;
            }
        }

        public override bool HasCustomAttribute(string attributeNamespace, string attributeName)
        {
            return _fieldDef.HasCustomAttribute(attributeNamespace, attributeName);
        }

        public override FieldDesc GetTypicalFieldDefinition()
        {
            return _fieldDef;
        }
    }
}