Skip to content

Conversation

gdotdesign
Copy link
Member

This PR adds alternative patterns to case statements.

case number {
  0 | 1 | 2 | 3 => "0-3"
  _ => "other"
}

@gdotdesign gdotdesign added this to the 0.24.0 milestone Mar 28, 2025
@gdotdesign gdotdesign requested a review from Sija March 28, 2025 15:05
@gdotdesign gdotdesign self-assigned this Mar 28, 2025
@gdotdesign gdotdesign force-pushed the alternative-patterns branch from a713d5a to 643f247 Compare March 28, 2025 15:08
@gdotdesign gdotdesign force-pushed the record-pattern-matching branch from 0a2d20d to f7e70af Compare April 3, 2025 13:06
@gdotdesign gdotdesign force-pushed the alternative-patterns branch from 643f247 to 3ae2a00 Compare April 3, 2025 13:07
Base automatically changed from record-pattern-matching to master April 3, 2025 13:16
@gdotdesign gdotdesign force-pushed the alternative-patterns branch from 3ae2a00 to 058dc6b Compare April 3, 2025 13:17
@gdotdesign gdotdesign merged commit 57ff3b0 into master Apr 3, 2025
3 checks passed
@gdotdesign gdotdesign deleted the alternative-patterns branch April 3, 2025 13:24
end,
to_pattern(node)
)
end].select(ExhaustivenessChecker::Pattern).first
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
end].select(ExhaustivenessChecker::Pattern).first
end].first(&.is_a?(ExhaustivenessChecker::Pattern))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants