Skip to content

Commit

Permalink
Adds logic to infer messages to literal classes
Browse files Browse the repository at this point in the history
Issue: #17
  • Loading branch information
0x7CFE committed May 25, 2016
1 parent feddc12 commit b0d8b87
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/TypeAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,12 @@ InferContext* TypeSystem::inferMessage(TSelector selector, const Type& arguments
TClass* receiver = 0;

if (self.getKind() == Type::tkLiteral) {
receiver = isSmallInteger(self.getValue()) ? globals.smallIntClass : self.getValue()->getClass();
if (isSmallInteger(self.getValue()))
receiver = globals.smallIntClass;
else if (self.getValue()->getClass()->getClass() == globals.stringClass->getClass()->getClass())
receiver = self.getValue()->cast<TClass>();
else
receiver = self.getValue()->getClass();
} else {
receiver = self.getValue()->cast<TClass>();
}
Expand Down

0 comments on commit b0d8b87

Please sign in to comment.