orleans
orleans copied to clipboard
Could not find a copier for type <>z__ReadOnlyArray`1[IFoo].
Using Orleans 8 I got this error message above
Could not find a copier for type <>z__ReadOnlyArray`1[IFoo].
at a rather simple call
await bar.AddFoo([this]);
Both bar and foo (this) are grains. I learned that the z__ReadOnlyArray type is Roslyn generated for array literals, which unfortunately seems to imply that I can't do
[assembly: GenerateCodeForDeclaringAssembly(typeof(z__ReadOnlyArray))]
as recommended elsewhere (or maybe I'm just doing it wrongly).
Thanks for reporting, @Jens-G! This should work if the parameter type of AddFoo is a concrete type, like List<T>. What is the signature of AddFoo in your example? Either way, I agree that we should implement support for this in-box
Yes, this works around the issue:
var tmp = new List<IFoo>() { this };
await bar.AddFoo(tmp);
The signature I use is this
Task AddFoo(IEnumerable<IFoo> list);
Also see #8934 and #8964