C
C#16mo ago
Ownix

❔ Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TResponse'

https://dotnetfiddle.net/uebISh Line 96. I have a contsraint that says where TResponse : Result so I am very confused about this error. Result.Error("Whatever."); IS Ardalis.Result.Result type...
Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TRespon...
Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TResponse' | Test your C# code online with .NET Fiddle code editor.
10 Replies
Feast
Feast16mo ago
show ur code
Anchy
Anchy16mo ago
he posted it as a dotnetfiddle link looks awful on my phone catderp
Ownix
OwnixOP16mo ago
Yeah theres a dotfiddle link @feast107
Ownix
OwnixOP16mo ago
okay so casting it to... itself worked. Still don't understand it though. state.SetHandled((TResponse)translatedResponse) https://dotnetfiddle.net/OJrjUD
[Fork] Argument 1: cannot convert from 'Ardalis.Result.Result' to '...
[Fork] Argument 1: cannot convert from 'Ardalis.Result.Result' to 'TResponse' | Test your C# code online with .NET Fiddle code editor.
Anchy
Anchy16mo ago
check the type stored in var
Ownix
OwnixOP16mo ago
@anchy Am I missing something?
Ownix
OwnixOP16mo ago
Constraint says TResponse is Result. state.SetHandled takes TResponse. Compiler is still confused.
Anchy
Anchy16mo ago
mouseover Result in the constraint
Ownix
OwnixOP16mo ago
@anchy
Accord
Accord16mo ago
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.
Want results from more Discord servers?
Add your server