Reproduction:
class MyApiServer extends RpcTarget {
getNames() {
return ["Alice", "Bob", "Charlie"];
}
greet(name: string) { return `Hello ${name}` }
}
declare const api: RpcStub<MyApiServer>
await api.getNames().map(async name => {
await someTask();
return api.greet(name);
})
IMO this should be a type error to be able to call .map() type safe. The user should get an error here because they're returning something that's not Result or valid container or constant serializable value. I'd expect when returning a native promise to get an error here.