Skip to content

Commit

Permalink
Fixes subtypes in array context
Browse files Browse the repository at this point in the history
Issue: #17
  • Loading branch information
0x7CFE committed May 26, 2016
1 parent bdeb3c0 commit e189b20
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/TypeAnalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ void TypeAnalyzer::doSendBinary(const InstructionNode& instruction) {
TSymbol* const selector = globals.binaryMessages[opcode]->cast<TSymbol>();

Type arguments(Type::tkArray);
arguments.addSubType(lhsType);
arguments.addSubType(rhsType);
arguments.addSubType(lhsType, false);
arguments.addSubType(rhsType, false);

if (InferContext* const context = m_system.inferMessage(selector, arguments))
result = context->getReturnType();
Expand Down Expand Up @@ -354,9 +354,9 @@ void TypeAnalyzer::doPushBlock(const InstructionNode& instruction) {
Type& blockType = m_context[instruction];

blockType.set(globals.blockClass, Type::tkMonotype);
blockType.addSubType(origin);
blockType.addSubType(Type(TInteger(offset)));
blockType.addSubType(Type(TInteger(argIndex)));
blockType.addSubType(origin, false);
blockType.addSubType(Type(TInteger(offset)), false);
blockType.addSubType(Type(TInteger(argIndex)), false);
}
}

Expand Down Expand Up @@ -473,7 +473,7 @@ void TypeAnalyzer::doPrimitive(const InstructionNode& instruction) {
arguments.addSubType(arg);

if (instruction.getArgumentsCount() == 3)
arguments.addSubType(m_context[*instruction.getArgument(2)]);
arguments.addSubType(m_context[*instruction.getArgument(2)], false);

if (InferContext* invokeContext = m_system.inferBlock(block, arguments))
primitiveResult = invokeContext->getReturnType();
Expand Down

0 comments on commit e189b20

Please sign in to comment.