C
C#17mo 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
Feast17mo ago
show ur code
Anchy
Anchy17mo ago
he posted it as a dotnetfiddle link looks awful on my phone catderp
Ownix
OwnixOP17mo ago
Yeah theres a dotfiddle link @feast107
Ownix
OwnixOP17mo 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
Anchy17mo ago
check the type stored in var
Ownix
OwnixOP17mo ago
@anchy Am I missing something?
Ownix
OwnixOP17mo ago
Constraint says TResponse is Result. state.SetHandled takes TResponse. Compiler is still confused.
Anchy
Anchy17mo ago
mouseover Result in the constraint
Ownix
OwnixOP17mo ago
@anchy
Accord
Accord17mo 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