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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//! `GenericParam` table loader implementation.
//!
//! This module provides the [`GenericParamLoader`] responsible for loading and processing
//! `GenericParam` metadata table entries. The `GenericParam` table defines generic type and method
//! parameters, including their names, constraints, and variance specifications.
//!
//! # Purpose
//! The `GenericParam` table is used for generic programming support:
//! - **Generic types**: Type parameters for generic classes and interfaces
//! - **Generic methods**: Method-level type parameters for generic methods
//! - **Constraint specification**: Variance and constraint information for parameters
//! - **Name resolution**: Names for generic parameters used in signatures
//! - **Reflection support**: Runtime access to generic parameter metadata
//!
//! # Generic Parameter Context
//! Generic parameters enable type-safe generic programming:
//! - **Type parameters**: `class List<T>` defines type parameter T
//! - **Method parameters**: `void Method<U>()` defines method parameter U
//! - **Constraints**: `where T : IComparable<T>` specifies constraints
//! - **Variance**: `IEnumerable<out T>` specifies covariance
//! - **Multiple parameters**: `class Dictionary<TKey, TValue>` with multiple parameters
//!
//! # Table Dependencies
//! - **`TypeDef`**: Required for resolving generic type owners
//! - **`TypeRef`**: Required for external type references
//! - **`TypeSpec`**: Required for type specifications
//! - **`MethodDef`**: Required for resolving generic method owners
//!
//! # ECMA-335 Reference
//! See ECMA-335, Partition II, §22.20 for the `GenericParam` table specification.
use crate::;
/// Loader implementation for the `GenericParam` metadata table.
///
/// This loader processes `GenericParam` table entries which define generic type and method
/// parameters. Each entry specifies a parameter's name, ordinal position, variance,
/// and owner (either a generic type or method).
///
/// # Errors
///
/// - Owner references cannot be resolved to types or methods
/// - String references cannot be resolved from the strings heap
/// - Memory allocation fails during processing
/// - Concurrent access conflicts occur
/// - Generic parameter application to owners fails
///
/// # ECMA-335 Reference
/// See ECMA-335, Partition II, §22.20 for complete `GenericParam` table specification.
pub ;