Skip to content

Commit 435933c

Browse files
author
Oisin Grehan
committed
update actor generic if to use contravariant type arg
Signed-off-by: Oisin Grehan <[email protected]>
1 parent 087f11b commit 435933c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

test/Dapr.Actors.Generators.Test/ActorClientGeneratorTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -893,10 +893,10 @@ public interface ITrait
893893
}
894894
895895
[GenerateActorClient]
896-
public interface ITestActor<TTrait> where TTrait : ITrait
896+
public interface ITestActor<in TTrait> where TTrait : ITrait
897897
{
898898
Task<bool> SetTrait(TTrait trait);
899-
Task<TTrait> GetTrait(string name);
899+
Task<ITrait> GetTrait(string name);
900900
}
901901
}";
902902

@@ -917,9 +917,9 @@ public TestActorClient(Dapr.Actors.Client.ActorProxy actorProxy)
917917
this.actorProxy = actorProxy;
918918
}
919919
920-
public System.Threading.Tasks.Task<TTrait> GetTrait(string name)
920+
public System.Threading.Tasks.Task<Test.ITrait> GetTrait(string name)
921921
{
922-
return this.actorProxy.InvokeMethodAsync<string, TTrait>(""GetTrait"", name);
922+
return this.actorProxy.InvokeMethodAsync<string, Test.ITrait>(""GetTrait"", name);
923923
}
924924
925925
public System.Threading.Tasks.Task<bool> SetTrait(TTrait trait)

0 commit comments

Comments
 (0)