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
Gleam uses the flatten_or function from https://github.com/yorickpeterse/pattern-matching-in-rust. I recently found out this implementation is incorrect, as it doesn't account for patterns such as foo or foo (i.e. OR patterns that bind variables in their branches). While such patterns are nonsensical (= they're always true), it would trigger a panic here.
The fix is to expand OR patterns earlier, before pushing bindings/wildcards out of the patterns. This is implemented here. The new setup could probably be improved performance wise, but as far as I can determine it works well enough.
Gleam uses the
flatten_or
function from https://github.com/yorickpeterse/pattern-matching-in-rust. I recently found out this implementation is incorrect, as it doesn't account for patterns such asfoo or foo
(i.e. OR patterns that bind variables in their branches). While such patterns are nonsensical (= they're always true), it would trigger a panic here.The fix is to expand OR patterns earlier, before pushing bindings/wildcards out of the patterns. This is implemented here. The new setup could probably be improved performance wise, but as far as I can determine it works well enough.
For some additional background information, see inko-lang/inko#679 and inko-lang/inko#599 which is how I found out about this.
The text was updated successfully, but these errors were encountered: