Skip to content

Commit

Permalink
Fixes Type::toString()
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 c9af814 commit 15a7e2a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions include/inference.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Type {
// tkMonotype (class name) (SmallInt)
// tkComposite (class name, ...) (SmallInt, *)
// tkArray class name [...] Array[String, *, (*, *), (True, False)]
std::string toString(bool subtypesOnly = false) const;
std::string toString(bool subtypesOnly = true) const;

Type(TKind kind = tkUndefined) : m_kind(kind), m_value(0) {}
Type(TObject* literal, TKind kind = tkLiteral) { set(literal, kind); }
Expand Down Expand Up @@ -79,7 +79,7 @@ class Type {
bool isBlock() const {
return
isMonotype() &&
m_value == globals.blockClass &&
(m_value == globals.blockClass) &&
!m_subTypes.empty();
}

Expand Down
4 changes: 2 additions & 2 deletions src/TypeAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static void printBlock(const Type& blockType, std::stringstream& stream) {
stream << blockType[Type::bstCaptureIndex].toString(); // capture context index
}

std::string Type::toString(bool subtypesOnly /*= false*/) const {
std::string Type::toString(bool subtypesOnly /*= true*/) const {
std::stringstream stream;

switch (m_kind) {
Expand Down Expand Up @@ -62,7 +62,7 @@ std::string Type::toString(bool subtypesOnly /*= false*/) const {
break;

case tkArray:
if (subtypesOnly)
if (!subtypesOnly)
stream << getValue()->cast<TClass>()->name->toString();
case tkComposite: {
stream << (m_kind == tkComposite ? "(" : "[");
Expand Down

0 comments on commit 15a7e2a

Please sign in to comment.