Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit return type annotation to avoid circular reference #197

Merged
merged 1 commit into from
Sep 19, 2023
Merged

Add explicit return type annotation to avoid circular reference #197

merged 1 commit into from
Sep 19, 2023

Conversation

igalshilman
Copy link
Contributor

The code before that PR doesn't compile with the newest typescript SDK as it is missing either an explicit type annotation, or an explicit type on the call site.

With the PR


Error: src/src/handler_api.ts(9,7): error TS7023: 'echoEcho' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
Error: src/src/handler_api.ts(10,16): error TS2615: Type of property 'echoEcho' circularly references itself in mapped type 'UnKeyedRouter<{ echo: (ctx: RpcContext, msg: any) => any; echoEcho: (ctx: RpcContext, msg: any) => any; }>'.

with it, everything builds successfully.

@igalshilman
Copy link
Contributor Author

see restatedev/sdk-typescript#166

@slinkydeveloper slinkydeveloper merged commit 833aad7 into restatedev:main Sep 19, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants