C
C#13mo ago
Mango

✅ generic mess

If I have a type that takes <T, E> is there a way to return T generically I.E.
private async Task<Result<T, string>> Get<T>(T type)
private async Task<Result<T, string>> Get<T>(T type)
Where T is a type I pass in
8 Replies
Mango
Mango13mo ago
So the T generic in my result is also the generic I pass into my method
sibber
sibber13mo ago
i dont understand does return type; not work?
Mango
Mango13mo ago
I'd really prefer returning my result type, it has error stuff involved if something goes awry
sibber
sibber13mo ago
why would that be different
Mango
Mango13mo ago
I'm confused I'm gonna reload VScode and if this red squiggles goes away I'm gonna be happy Okay so I thought the code I sent was wrong but it was just bug with my editor After reloading the error is gone
sibber
sibber13mo ago
vscode moment
Mango
Mango13mo ago
$close
MODiX
MODiX13mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server
More Posts