Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ASRUtils: Support TypeParameter in types_equal()
  • Loading branch information
ubaidsk committed Aug 28, 2023
commit 26a5b35bdb302ddc9e3a8a5b71a3ffedc0f6c811
7 changes: 7 additions & 0 deletions src/libasr/asr_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -2492,6 +2492,13 @@ inline bool types_equal(ASR::ttype_t *a, ASR::ttype_t *b,
a2->m_dims, a2->n_dims,
b2->m_dims, b2->n_dims);
}
case (ASR::ttypeType::TypeParameter) : {
ASR::TypeParameter_t* left_tp = ASR::down_cast<ASR::TypeParameter_t>(a);
ASR::TypeParameter_t* right_tp = ASR::down_cast<ASR::TypeParameter_t>(b);
std::string left_param = left_tp->m_param;
std::string right_param = right_tp->m_param;
return left_param == right_param;
}
case (ASR::ttypeType::Integer) : {
ASR::Integer_t *a2 = ASR::down_cast<ASR::Integer_t>(a);
ASR::Integer_t *b2 = ASR::down_cast<ASR::Integer_t>(b);
Expand Down