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

Fix return type #4

Open
roxblnfk opened this issue Apr 26, 2024 · 3 comments
Open

Fix return type #4

roxblnfk opened this issue Apr 26, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@roxblnfk
Copy link
Member

Looks like this return type doesn't work well

* @return ($type is class-string ? T|WorkflowProxy : WorkflowStubInterface)

@roxblnfk roxblnfk added the bug Something isn't working label Apr 26, 2024
@dimajolkin
Copy link

If use of documentation:

Psalm documentation:
(https://psalm.dev/docs/annotating_code/type_syntax/conditional_types/)


Conditional types have the form:

(<template param> is <union type> ? <union type> : <union type>)

Current implement:

IDE don't undestand complex templates condition..
image

But if we rewrite this code

@roxblnfk
Copy link
Member Author

I think it will be better to rewrite the code and separate stub and proxy factories into different functions. It's a bad thing when different interfaces are return depending on input type

@roxblnfk
Copy link
Member Author

It will be rewritten after temporal sdk 2.9 release. There are new concepts discussed around proxies and stubs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants