Fixed incorrect constant types and added unit test.

This commit is contained in:
2017-06-18 00:18:22 +02:00
parent 101f33df6e
commit bfb382de52
3 changed files with 31 additions and 2 deletions

View File

@@ -52,7 +52,7 @@ void parseAndAddConstantDeclarations(Context &context, ast::Domain &domain, ast:
constantDeclarations[i]->type = ast::deepCopy(parentType);
// All types up to now are labeled with their parent types
inheritanceIndex = constantDeclarations.size() + 1;
inheritanceIndex = constantDeclarations.size();
tokenizer.skipWhiteSpace();
}

View File

@@ -65,7 +65,7 @@ void parseAndAddPrimitiveTypeDeclarations(Context &context, ast::Domain &domain)
types[i]->parentTypes.emplace_back(ast::deepCopy(parentType));
// All types up to now are labeled with their parent types
inheritanceIndex = types.size() + 1;
inheritanceIndex = types.size();
tokenizer.skipWhiteSpace();
}