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

Doesn't narrow when there's leading ? #1

Closed
devanshj opened this issue Jan 6, 2022 · 2 comments
Closed

Doesn't narrow when there's leading ? #1

devanshj opened this issue Jan 6, 2022 · 2 comments

Comments

@devanshj
Copy link
Owner

devanshj commented Jan 6, 2022

import { p, pa } from "@sthir/predicate"

declare let x:
  | { a: string }
  | undefined

if (pa(x, p("?.a"))) {
  x.a
  // should compile, doesn't
}
@VinSpee
Copy link

VinSpee commented Jan 6, 2022

edit: ➡️ Moved to #2

@devanshj
Copy link
Owner Author

devanshj commented Jan 6, 2022

Thanks for reporting, although your case doesn't belong to this issue, I'll open a new one. This is another issue that I happen to find out, and when fixed doesn't solve yours.

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

2 participants