Skip to content

Untagged error messages #6290

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

Merged
merged 8 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#### :bug: Bug Fix

- Fix issue where uncurried type internals leak in type error. https://github.com/rescript-lang/rescript-compiler/pull/6264
- Improve error messages for untagged variant definitions https://github.com/rescript-lang/rescript-compiler/pull/6290


# 11.0.0-beta.1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/UntaggedNonUnary1.res:2:1-27

1 │ @unboxed
2 │ type t = Tuple(int, string)
3 │

This untagged variant definition is invalid: Constructor Tuple has more than one argument.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/UntaggedNonUnary2.res:2:1-42

1 │ @unboxed
2 │ type t = Tuple(int, string) | Float(float)
3 │

This untagged variant definition is invalid: Constructor Tuple has more than one argument.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

We've found a bug for you!
/.../fixtures/UntaggedUnknown.res:2:10-31

1 │ @unboxed
2 │ type t = Tuple((float, string)) | Float(float)
3 │

This untagged variant definition is invalid: Case Tuple has a payload that is not of one of the recognized shapes (object, array, etc). Then it must be the only case with payloads.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@unboxed
type t = Tuple(int, string)
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@unboxed
type t = Tuple(int, string) | Float(float)
2 changes: 2 additions & 0 deletions jscomp/build_tests/super_errors/fixtures/UntaggedUnknown.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@unboxed
type t = Tuple((float, string)) | Float(float)
Loading