We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When trying to patch methods like
Foo<T>.Method
Foo.Method<T>
patching fails with a somewhat cryptic error like
HarmonyLib.HarmonyException: IL Compile Error (unknown location) ---> HarmonyLib.HarmonyException: IL Compile Error (unknown location) ---> System.NotSupportedException: Specified method is not supported. at MonoMod.Utils.MMReflectionImporter.ImportGenericParameter (System.Type type, Mono.Cecil.IGenericParameterProvider context) [0x0008f] in <6733e342b5b549bba815373898724469>:0 at MonoMod.Utils.MMReflectionImporter._ImportReference (System.Type type, Mono.Cecil.IGenericParameterProvider context, MonoMod.Utils.MMReflectionImporter+GenericImportKind importKind) [0x00130] in <6733e342b5b549bba815373898724469>:0 at MonoMod.Utils.MMReflectionImporter._ImportGenericInstance (System.Type type, Mono.Cecil.IGenericParameterProvider context, Mono.Cecil.TypeReference typeRef) [0x0001c] in <6733e342b5b549bba815373898724469>:0 at MonoMod.Utils.MMReflectionImporter._ImportReference (System.Type type, Mono.Cecil.IGenericParameterProvider context, MonoMod.Utils.MMReflectionImporter+GenericImportKind importKind) [0x00122] in <6733e342b5b549bba815373898724469>:0 at MonoMod.Utils.MMReflectionImporter.ImportReference (System.Type type, Mono.Cecil.IGenericParameterProvider context) [0x00000] in <6733e342b5b549bba815373898724469>:0
Instead of letting the invalid target propagate to MonoMod, it's better to fail early with a clear message like
Generic methods cannot be patched. Assign the generic parameters (e.g. Foo<int> instead of Foo<T>).
and don't let patching proceed further.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When trying to patch methods like
Foo<T>.Method
Foo.Method<T>
patching fails with a somewhat cryptic error like
Instead of letting the invalid target propagate to MonoMod, it's better to fail early with a clear message like
and don't let patching proceed further.
The text was updated successfully, but these errors were encountered: