Skip to content

Commit

Permalink
HIR Typecheck - Fix match_test_generics_fuzz on const generics
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Jan 7, 2024
1 parent 7be37db commit 73ea9b7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/hir/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,17 +303,19 @@ ::HIR::Compare HIR::PathParams::match_test_generics_fuzz(const Span& sp, const P
}
for( unsigned int i = 0; i < x.m_values.size(); i ++ )
{
if( const auto* ge = this->m_values[i].opt_Generic() ) {
rv &= match.match_val(*ge, x.m_values[i]);
const auto& val_t = resolve_placeholder.get_val(sp, this->m_values[i]);
const auto& val_x = resolve_placeholder.get_val(sp, x.m_values[i]);
if( const auto* ge = val_t.opt_Generic() ) {
rv &= match.match_val(*ge, val_x);
if(rv == Compare::Unequal)
return Compare::Unequal;
}
else {
// TODO: Look up the the ivars?
if( this->m_values[i].is_Infer() ) {
if( val_t.is_Infer() || val_x.is_Infer() ) {
return Compare::Fuzzy;
}
if( this->m_values[i] != x.m_values[i] ) {
if( val_t != val_x ) {
return Compare::Unequal;
}
}
Expand Down

0 comments on commit 73ea9b7

Please sign in to comment.