facebook / facebook/flow

Opaque type and %checks type refinement functions do not refine the type

Open
#6,106 1 comment 0 reactions 0 assignees View on GitHub
Typing: refinements
Dominant language
Rust
Stars
22.3k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Here's the [flow.org/try link](https://flow.org/try/#0PTAEBcAsEsGdQCYHsCmsB2BycoDuSAnAawCgEUBjAGwEMCVQkAHGgRwFcHwBPJhgNRpVoCAMrgC0dAHMAXKADeJUBF4p5mAG5CRmADTLQ2qp3mwJU6SQC+AbhJlKteoxYcua0AEl0xkeMkZeSUVHj4NKT8EfUNjU1B0dioqGwcQCBh4fGJYEmAAKhIwgR0xCxlQAF5FQ2KNKJiVOPVQc0CrOwdi719SgMsqmtC1CN7haIMmoXjE5NT84C7PUT4KaCF+isrDAB9QQXHNqxU9nyij+xIAM3Z0CnBoJHQjUoAKFih0GgBbFpXKdZUI4ASnkACMkEgqCgaM8AKQUSCUIjwBSgejgdgEZ4fSBfX4AOm6lRJoC0pUwtlA1mut3uj2ekTeuPxf1WgJB4Mh0NhoARSIoKMU6JQmOxoBZPxQRM8JOqmCZ40p1IcFCe5la7I25TkoH+a217UGr1mVHksO4wMuNzuDyeoDB7GgVAQADEklQAILfGgALyeAFUCFRXQQkN8AAo0T5S97yA7+HWg1o6oYisXPTA0WAIK6U1IkaBXUCvKKvWBaoFJ4Fpx3Ot0e71+wPB0PhqMx37lysg+zWIA)

Try commenting in/out the type declaration sections.

When using regular types, I can define refinement functions that work. When using opaque types, suddenly things don't work. Unfortunately to build full functionality out using opaque types

cc @panagosg7 in case you might know how to handle this / where to forward this. I searched around and noticed you had done work on `%checks` before. let me know how I can help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.