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

Can't specify the class as a return type of function. #236

Closed
Kray-G opened this issue Mar 22, 2021 · 0 comments
Closed

Can't specify the class as a return type of function. #236

Kray-G opened this issue Mar 22, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Kray-G
Copy link
Owner

Kray-G commented Mar 22, 2021

The code will show the error.

class A() {}

function f(): A {
    return new A(); // => Error: Expect return type (object) but (... unknown)
}
@Kray-G Kray-G added the bug Something isn't working label Mar 22, 2021
@Kray-G Kray-G self-assigned this Mar 22, 2021
Kray-G added a commit that referenced this issue Mar 24, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Mar 24, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Mar 24, 2021
refs #236: type propagation to call-node.
Kray-G added a commit that referenced this issue Mar 24, 2021
refs #236: type propagation to call-node.
@Kray-G Kray-G closed this as completed in 3fa599b Mar 24, 2021
Kray-G added a commit that referenced this issue Apr 7, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Apr 7, 2021
refs #236: type propagation to call-node.
Kray-G added a commit that referenced this issue Apr 7, 2021
Kray-G added a commit that referenced this issue Apr 7, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Apr 7, 2021
refs #236: type propagation to call-node.
Kray-G added a commit that referenced this issue Apr 7, 2021
Kray-G added a commit that referenced this issue Apr 7, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Apr 7, 2021
refs #236: type propagation to call-node.
Kray-G added a commit that referenced this issue Apr 7, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Apr 7, 2021
refs #236: type propagation to call-node.
Kray-G added a commit that referenced this issue Apr 7, 2021
fixed #236: correctly handling class type.
Kray-G added a commit that referenced this issue Apr 7, 2021
refs #236: type propagation to call-node.
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

1 participant