IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
MissingTypeParameter.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2011-2012 Jeroen Frijters
3
4 This software is provided 'as-is', without any express or implied
5 warranty. In no event will the authors be held liable for any damages
6 arising from the use of this software.
7
8 Permission is granted to anyone to use this software for any purpose,
9 including commercial applications, and to alter it and redistribute it
10 freely, subject to the following restrictions:
11
12 1. The origin of this software must not be misrepresented; you must not
13 claim that you wrote the original software. If you use this software
14 in a product, an acknowledgment in the product documentation would be
15 appreciated but is not required.
16 2. Altered source versions must be plainly marked as such, and must not be
17 misrepresented as being the original software.
18 3. This notice may not be removed or altered from any source distribution.
19
20 Jeroen Frijters
21 jeroen@frijters.net
22
23*/
24namespace IKVM.Reflection
25{
26
27 sealed class MissingTypeParameter : IKVM.Reflection.Reader.TypeParameterType
28 {
29
30 readonly MemberInfo owner;
31 readonly int index;
32
38 internal MissingTypeParameter(Type owner, int index) :
39 this(owner, index, Signature.ELEMENT_TYPE_VAR)
40 {
41
42 }
43
49 internal MissingTypeParameter(MethodInfo owner, int index) :
50 this(owner, index, Signature.ELEMENT_TYPE_MVAR)
51 {
52
53 }
54
61 MissingTypeParameter(MemberInfo owner, int index, byte sigElementType) :
62 base(sigElementType)
63 {
64 this.owner = owner;
65 this.index = index;
66 }
67
68 public override Module Module
69 {
70 get { return owner.Module; }
71 }
72
73 public override string Name
74 {
75 get { return null; }
76 }
77
78 public override int GenericParameterPosition
79 {
80 get { return index; }
81 }
82
83 public override MethodBase DeclaringMethod
84 {
85 get { return owner as MethodBase; }
86 }
87
88 public override Type DeclaringType
89 {
90 get { return owner as Type; }
91 }
92
93 internal override Type BindTypeParameters(IGenericBinder binder)
94 {
95 if (owner is MethodBase)
96 return binder.BindMethodParameter(this);
97 else
98 return binder.BindTypeParameter(this);
99 }
100
101 internal override bool IsBaked
102 {
103 get { return owner.IsBaked; }
104 }
105
106 }
107
108}
IKVM.Reflection.MethodBase MethodBase
global::java.lang.invoke.LambdaForm.Name Name
Type BindMethodParameter(Type type)
Type BindTypeParameter(Type type)