You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-19Lines changed: 34 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,9 +31,11 @@ SourceReflection aims to provide a more universal solution, offering `AOTable` R
31
31
- Generic type definition
32
32
- Generic method *
33
33
34
-
> Currently, support for generic type definition is not yet available. The main issue lies in the handling of `MarkGenericType`. I am currently experimenting with more effective approaches, but there is no specific plan at the moment.
34
+
> Currently, support for generic type definition is not yet available. The main issue lies in the handling of `MakeGenericType`.
35
35
36
-
> Similar to generic types, there are also generic methods. The issue lies in `MarkGenericMethod`. However, it can currently handle some specific cases, such as situations where the generic type can be inferred.
36
+
> Similar to generic types, there are also generic methods. The issue lies in `MakeGenericMethod`. However, it can currently handle some specific cases, such as situations where the generic type can be inferred.
37
+
38
+
`.NET 9` has made significant improvements to AOT and can support `MakeGenericType` and `MakeGenericMethod`. However, there is still a significant amount of work to be done in SourceReflection. Support will be added in subsequent versions
37
39
38
40
**Adapters**
39
41
-`System.Text.Json` Adapter, supports `AOT` without JsonSerializerContext
@@ -235,7 +237,7 @@ var o6 = SourceReflector.CreateInstance(typeof(CreateInstanceTestObject), 1, 2,
235
237
236
238
## Generic Definition
237
239
238
-
Currently, support for generic type definition is not yet available. The main issue lies in the handling of `MarkGenericType`. I am currently experimenting with more effective approaches, but there is no specific plan at the moment.
240
+
Currently, support for generic type definition is not yet available. The main issue lies in the handling of `MakeGenericType`. I am currently experimenting with more effective approaches, but there is no specific plan at the moment.
Currently, support for generic type definition is not yet available. The main issue lies in the handling of `MarkGenericType`. The source generation can handle handle known types.
257
+
Currently, support for generic type definition is not yet available. The main issue lies in the handling of `MakeGenericType`. The source generation can handle handle known types.
When the generic type cannot be inferred, the only option is to use runtime reflection through `MarkGenericMethod`, which will not be supported in AOT compilation.
317
+
When the parameter type can be inferred and cast to the constraint type, the only option is to use runtime reflection through `MakeGenericMethod`, which will not be supported in AOT compilation.
Even if the type can be inferred, this approach has its drawbacks. If the internal implementation of the method has type checks on the generic parameters, the result may not meet expectations.
323
+
Even if the type can be inferred and can be explicitly cast to a constrained type, this approach has its drawbacks. If the internal implementation of the method has type checks on the generic parameters, the result may not meet expectations.
0 commit comments