11 Replies
What happens if I have an object of type IntegerTempClass under the variable someBaseClass, will Method2 get called in this case?
Or how to design the code so that this Method2 is able to call itself regardless of the type given in the generic?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Let me check that
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It doesn't work
Updated code:
It doesn't register Method2 to event.
I checked that with .NET Fiddle online
so you can paste it also
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
cap5lut#0057
REPL Result: Success
Result: bool
Compile: 459.863ms | Execution: 37.590ms | React with ❌ to remove this embed.
cap5lut#0057
REPL Result: Success
Result: bool
Compile: 442.724ms | Execution: 50.540ms | React with ❌ to remove this embed.
basically there lies ur problem
A<int>
and A<object>
are "different" typesYeah, I know 😅 How to fix this code design?
Ok, but what should I do to make this Method2 be called?
regardless of the type
Is there any solution for that?
I wanted to be able to have ClientClass accept any type of class, but at the same time be able to call ToString on that type when calling an event.
Okay, unfortunately I can't influence the TGC code or the base class. I can only design the ClientClass differently.
Well it looks like I can't do what I wanted to do. Too bad, although it's not a dealbreaker.
Thanks guys!
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.