Replies: 1 comment 1 reply
-
Not related to your question, but your code won't work because: The result of In addition, why don't you use the |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to make a method that return
delegate* unmanaged<T, T1, ..., TOut>
and accept a method. I'm tired of writing every time for methodTOut Meth(T, T1, ...)
castes indelegate* unmanaged<T, T1, ..., TOut>
, like:I trying make:
But I get error: The type arguments for method 'ldftn<T, T2, TOut>(Func<T, T2, TOut>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
I can fix this by defining a generic type when calling:
BUT IF I DEFINE WRONG GENERICS, THEN AN ERROR CS0407 WILL COME UP:
THAT THE Meth METHOD HAS THE WRONG ARGUMENTS OR RETURN TYPE, THAT IS, THE COMPILER KNOWS WHAT ARGUMENTS METH HAS AND IT WOULD BE LOGICAL THAT I DIDN’T WRITE THE GENERICS MYSELF.
Beta Was this translation helpful? Give feedback.
All reactions