Resolving GenericParameter #848
Unanswered
m-carrasco
asked this question in
Q&A
Replies: 1 comment 1 reply
-
I think I've might have found an answer: https://groups.google.com/g/mono-cecil/c/m_hv7mHXpCI I'll update if I solved my issue. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone,
I just want to ask for some help with this problem. I've been reading old issues but I am still uncertain if my understanding is correct.
In my code, there is a
MethodReference method
toTResult System.Func2<Interop/ErrorInfo,Interop/ErrorInfo>::Invoke(T)
. This reference comes from the callvirt instruction at offsetIL_0005
(seemonodis
output at the bottom).My problem is that
method.ReturnType.Resolve()
is returningnull
, and in case it is relevant,ReturnType
is pointing to aGenericParameter
instance.Ultimately, I'd like
method.ReturnType.Resolve()
to return aTypeDefinition
reference toInterop/ErrorInfo
.However, I think I may be dealing with two different issues (on my side - not cecil) here.
method.ReturnType.Resolve()
is returning null could be because my application is a net6 one while I'm telling Cecil (running in net6) to load a mono's DLL. Does this make any sense?Resolve()
ever return aTypeDefinition
reference toInterop/ErrorInfo
?Any suggestion/feedback/explanation regarding these points would be illuminating.
As a related issue, I found this old question https://groups.google.com/g/mono-cecil/c/fIOqSZQvA1o. I suspect I may need to use
IGenericParameterProvider
andIGenericContext
somehow.Best regards,
Manuel.
The full method is
ThrowExceptionForIoErrno
listed below, which is defined in theInterop
class in mono'smscorlib
.Beta Was this translation helpful? Give feedback.
All reactions