Skip to content

Commit

Permalink
Lower MIR - Handle different orderings of bindings in | patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Jul 18, 2024
1 parent 03e59e6 commit 02fca31
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mir/from_hir_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,8 @@ void MIR_LowerHIR_Match( MirBuilder& builder, MirConverter& conv, ::HIR::ExprNod
size_t first_rule = arm_rules.size();
for(auto& sr : pat_builder.m_rulesets)
{
::std::sort(sr.m_bindings.begin(), sr.m_bindings.end(),
[](const PatternBinding& a, const PatternBinding& b){ return a.binding->m_slot < b.binding->m_slot; });
size_t i = &sr - &pat_builder.m_rulesets.front();
if( sr.m_is_impossible )
{
Expand Down

0 comments on commit 02fca31

Please sign in to comment.