How to get a generic method which generic type is private by UnsafeAccessor #121919
Unanswered
wherewhere
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
It seems to be a known limitation: |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
We have a class
C, which has a private methodGetType<T>:Then we have a private class
B:Now how to get the method
A.GetType<B>?I try to write type in the
NameofUnsafeAccessor:But it cannot find the method...
I also try the
GetType[[B]],GetType`1[[B]],GetType[B],GetType`1[B], but none of it work.For now, I got a way by create a wrapper generic class:
Then use
UnsafeAccessorto accessC<B>.GetType:For all:
Playground:
https://wherewhere.github.io/SharpScript/#code=K4Zwlgdg5gBAygTxAFwKYFsDcAoUlaIoYB0ASsBMmOqsQMID26ADmADaoBOcXAbmAGNUIHIwggGHYgHVOYNABlIqABQBxVMgAqCZqojA2bAJTGcAbQCq4gIYAzVAEEBQkBM4rrIe05fD3ANKQACbEcMg2VAIAspoAFgzBADQwAHI2NDAAvDAARBrauqi5xgC62CiRgjCoAB5onBAwOnowBS2qVrYOzq7uHSq5dAAGAIzmAEKlJaUwDABGAFaoAsgA%2FDARnFCaZhURUTACbDZuMI4wAN7YMLcwlYcdbZodADxaAHwqxtkfm0UMOwqLR7AC%2B2GOpxAMAmOEhZzo7z%2B1zu9wO1Se7SK3yuN1Rdy63h6fjcDA8Xh8vX8ZKCEFC4SqMXiiRS6UyOXyLyKMzx%2BLRjJq9S4TSeFOJfTJr0sX0JlJJ%2FWxuUcMzmSxW602Nm2uxwfNunE0wEaMDFvglnCRKgMRj2qPBoKAA%3D%3D
Beta Was this translation helpful? Give feedback.
All reactions