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

Type guard (%checks) doesn't refine any type #7834

Closed
FezVrasta opened this issue Jun 18, 2019 · 3 comments
Closed

Type guard (%checks) doesn't refine any type #7834

FezVrasta opened this issue Jun 18, 2019 · 3 comments

Comments

@FezVrasta
Copy link
Contributor

FezVrasta commented Jun 18, 2019

Flow version: 0.101.0

Expected behavior

I would expect an any type to be refined to the checked type when guarded by a %checks call.

Actual behavior

The any type is preserved.

@FezVrasta
Copy link
Contributor Author

@goodmind that's not the same thing tho, in your example the pet variable has the type assigned, and it's the type guard which allows any.

@SamChou19815
Copy link
Contributor

This is due to limitation of refinement system. We have to have a literal tag for disjoint union.

@SamChou19815 SamChou19815 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants