You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make variant pattern matching not rely on tags being int
There are several ways in which the compilation of variants relies on tags being integers:
- Sometimes it uses booleans `if x` to mean `x !=0` to mean: not the first variant (i.e. tag 0)
- Sometimes it uses intervals `if (x > 3 || x < 1)`
Care is required not to change the compilation of variants with special compilation:
- true and false
- lists have constructors "[]" and "::"
- options have a specific definition for "Some" and "None"
See #6077
Copy file name to clipboardexpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,7 @@ These are only breaking changes for unformatted code.
74
74
- New internal representation for uncurried functions using built-in type `function$<fun_type, arity>` this avoids having to declare all the possible arities ahead of time https://github.com/rescript-lang/rescript-compiler/pull/5870
75
75
- PPX V3: allow uncurried `make` function and treat it like a curried one https://github.com/rescript-lang/rescript-compiler/pull/6081
76
76
- Add support for `|>` in uncurried mode by desugaring it https://github.com/rescript-lang/rescript-compiler/pull/6083
77
+
- Change the compilation of pattern matching for variants so it does not depends on variats being integers https://github.com/rescript-lang/rescript-compiler/pull/6085
0 commit comments