IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
UnboundGenericMethodParameter.cs
Go to the documentation of this file.
1/*
2 Copyright (C) 2009-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*/
24using System;
25using System.Collections.Generic;
26
28{
29
31 {
32
33 sealed class DummyModule : NonPEModule
34 {
35
39 internal DummyModule() :
40 base(new Universe())
41 {
42
43 }
44
45 protected override Exception NotSupportedException()
46 {
47 return new InvalidOperationException();
48 }
49
50 protected override Exception ArgumentOutOfRangeException()
51 {
52 return new InvalidOperationException();
53 }
54
55 public override bool Equals(object obj)
56 {
57 throw new InvalidOperationException();
58 }
59
60 public override int GetHashCode()
61 {
62 throw new InvalidOperationException();
63 }
64
65 public override string ToString()
66 {
67 throw new InvalidOperationException();
68 }
69
70 public override int MDStreamVersion
71 {
72 get { throw new InvalidOperationException(); }
73 }
74
75 public override Assembly Assembly
76 {
77 get { throw new InvalidOperationException(); }
78 }
79
80 internal override Type FindType(TypeName typeName)
81 {
82 throw new InvalidOperationException();
83 }
84
85 internal override Type FindTypeIgnoreCase(TypeName lowerCaseName)
86 {
87 throw new InvalidOperationException();
88 }
89
90 internal override void GetTypesImpl(List<Type> list)
91 {
92 throw new InvalidOperationException();
93 }
94
95 public override string FullyQualifiedName
96 {
97 get { throw new InvalidOperationException(); }
98 }
99
100 public override string Name
101 {
102 get { throw new InvalidOperationException(); }
103 }
104
105 public override Guid ModuleVersionId
106 {
107 get { throw new InvalidOperationException(); }
108 }
109
110 public override string ScopeName
111 {
112 get { throw new InvalidOperationException(); }
113 }
114
115 }
116
117 static readonly DummyModule module = new DummyModule();
118
119 readonly int position;
120
121 internal static Type Make(int position)
122 {
123 return module.Universe.CanonicalizeType(new UnboundGenericMethodParameter(position));
124 }
125
130 UnboundGenericMethodParameter(int position) :
131 base(Signature.ELEMENT_TYPE_MVAR)
132 {
133 this.position = position;
134 }
135
136 public override bool Equals(object obj)
137 {
138 var other = obj as UnboundGenericMethodParameter;
139 return other != null && other.position == position;
140 }
141
142 public override int GetHashCode()
143 {
144 return position;
145 }
146
147 public override string Namespace
148 {
149 get { throw new InvalidOperationException(); }
150 }
151
152 public override string Name
153 {
154 get { throw new InvalidOperationException(); }
155 }
156
157 public override int MetadataToken
158 {
159 get { throw new InvalidOperationException(); }
160 }
161
162 public override Module Module
163 {
164 get { return module; }
165 }
166
167 public override int GenericParameterPosition
168 {
169 get { return position; }
170 }
171
172 public override Type DeclaringType
173 {
174 get { return null; }
175 }
176
177 public override MethodBase DeclaringMethod
178 {
179 get { throw new InvalidOperationException(); }
180 }
181
182 public override Type[] GetGenericParameterConstraints()
183 {
184 throw new InvalidOperationException();
185 }
186
187 public override CustomModifiers[] __GetGenericParameterConstraintCustomModifiers()
188 {
189 throw new InvalidOperationException();
190 }
191
192 public override GenericParameterAttributes GenericParameterAttributes
193 {
194 get { throw new InvalidOperationException(); }
195 }
196
197 internal override Type BindTypeParameters(IGenericBinder binder)
198 {
199 return binder.BindMethodParameter(this);
200 }
201
202 internal override bool IsBaked
203 {
204 get { throw new InvalidOperationException(); }
205 }
206
207 }
208
209}
global::java.lang.invoke.LambdaForm.Name Name
virtual Exception InvalidOperationException()
Type BindMethodParameter(Type type)