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

Stubs not generating correct return on optional var #1922

Closed
ruudboon opened this issue Sep 23, 2019 · 2 comments
Closed

Stubs not generating correct return on optional var #1922

ruudboon opened this issue Sep 23, 2019 · 2 comments
Assignees
Labels

Comments

@ruudboon
Copy link
Contributor

When generating stubs and we have something like:

public function getVar(string! key) -> var | null

It will result in something like this causing a PHP error.

public function getVar(string $key): ? {}

Expected result

public function getVar(string $key) {}
@danhunsaker
Copy link
Contributor

Looks like the null check needs to be tempered by whether there's a concrete non-null type being output.

@sergeyklay sergeyklay added the bug label Sep 25, 2019
@sergeyklay sergeyklay self-assigned this Sep 30, 2019
@sergeyklay
Copy link
Contributor

Fixed in the development branch. Feel free to open a new issue if the problem appears again. Thank you for the bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants