Skip to content

Commit

Permalink
Adds Type::isBlock()
Browse files Browse the repository at this point in the history
Issue: #17
Issue: #92
  • Loading branch information
0x7CFE committed Jul 17, 2016
1 parent cc2e736 commit f2c78e3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/inference.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ class Type {
bool isArray() const { return m_kind == tkArray; }
bool isPolytype() const { return m_kind == tkPolytype; }

bool isBlock() const {
return
isMonotype() &&
m_value == globals.blockClass &&
!m_subTypes.empty();
}

const TSubTypes& getSubTypes() const { return m_subTypes; }

Type& pushSubType(const Type& type) { m_subTypes.push_back(type); return m_subTypes.back(); }
Expand Down

0 comments on commit f2c78e3

Please sign in to comment.