Type Parameter Issues
This one has a lot of code. (it was too much for discord, find em here https://pastebin.com/uXUCwmVQ)
The issue is in the construction of a request. I have no clue what is going on, but for some reason, I can do this with absolutely no errors:
And, yes, I tried this:
For some reason, I can set an integer to a boolean? I think I am a very advanced programmer, but this has me stumped. Any help appreciated!
22 Replies
⌛
This post has been reserved for your question.
Hey @The Typhothanian! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Wdym
Well Boolean doesn't extend integer, so I have no clue why it's allowing me to do that
And same with other stuff like strings
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Well that's not how it's worked for me in the past
And I'm doing Boolean no boolean I'm pretty sure
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Ok
But there is no string, only String, so I have no clue on that one
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Yeah. If I add a variable like
Request<Integer>
it recognizes it as an error. Is there a way to adjust the method to fix it? I don't want to have to state the class twice to get it to work.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
So how to fix that
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Ye I'm on phone too
And that kinda defeats the purpose of the enum. If it's the hard then I guess I'll just use strings for identifiers.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Cool
I meant because this is for server-client stuff, so it will need to be serializable, any ideas on a method that can get the variable name?
Actually better idea: integer id
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
What is java reflection?
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
oh
just asked chat gpt so I think I understand more
looks cool
thank you
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Post Closed
This post has been closed by <@801145088830210129>.