-
Notifications
You must be signed in to change notification settings - Fork 468
Fatal error: Matching.comp_exit on switch ... if
#5743
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
Comments
Probably related: #5557 |
cristianoc
added a commit
that referenced
this issue
Oct 19, 2022
…t working Fixes #5557 Fixes #5743 Exhaustiveness check for pattern matching relies on checking that the pattern does not lead to a type error. Since char constants are represented internally as int, this causes an internal type error when processing patterns of the form 'x', where the constant is represented as `Pconst_integer` but the expected type is `char`. This PR intercepts this situation and changes the expected type to `int`. A cleaner solution would be to represent chars differently (but we can't change the AST), or make it official that char and int is the same type (and lose some abstraction).
cristianoc
added a commit
that referenced
this issue
Oct 19, 2022
#5744) * Fix issue where exhaustiveness check for pattern matching char was not working Fixes #5557 Fixes #5743 Exhaustiveness check for pattern matching relies on checking that the pattern does not lead to a type error. Since char constants are represented internally as int, this causes an internal type error when processing patterns of the form 'x', where the constant is represented as `Pconst_integer` but the expected type is `char`. This PR intercepts this situation and changes the expected type to `int`. A cleaner solution would be to represent chars differently (but we can't change the AST), or make it official that char and int is the same type (and lose some abstraction). * comment
butterunderflow
pushed a commit
to butterunderflow/rescript-compiler
that referenced
this issue
Oct 31, 2022
butterunderflow
pushed a commit
to butterunderflow/rescript-compiler
that referenced
this issue
Oct 31, 2022
add a test case snapshot
butterunderflow
pushed a commit
to butterunderflow/rescript-compiler
that referenced
this issue
Oct 31, 2022
add a test case snapshot change Pconst_char payload (WIP) tweak tweak representation of char for lambda lib bugfix: replace wrong pp libs bugfix: replace wrong print use unsafe_chr to handle possible overflow char safe print int as char reduce duplication (re)use encodeCodepoint to support string_of_int_as_char some refactor libs CHANGELOG.md
butterunderflow
pushed a commit
to butterunderflow/rescript-compiler
that referenced
this issue
Oct 31, 2022
add a test case snapshot change Pconst_char payload (WIP) representation of char for lambda safe print int as char reduce duplication (re)use encodeCodepoint to support string_of_int_as_char some refactor CHANGELOG.md some cleanup CHANGELOG.md
butterunderflow
pushed a commit
to butterunderflow/rescript-compiler
that referenced
this issue
Oct 31, 2022
add a test case snapshot change Pconst_char payload (WIP) representation of char for lambda safe print int as char reduce duplication (re)use encodeCodepoint to support string_of_int_as_char some refactor CHANGELOG.md changelog
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I got an fatal error :
With the minimal test case:
With VSCode information:

Just wondering if anything I'd missed?
The text was updated successfully, but these errors were encountered: