Browse Source

ExpressionManager: Asserted that when getting a variable with declareOrGetVariable, the returned type is as expected.

tempestpy_adaptions
Tim Quatmann 6 years ago
parent
commit
adaba03648
  1. 1
      src/storm/storage/expressions/ExpressionManager.cpp

1
src/storm/storage/expressions/ExpressionManager.cpp

@ -167,6 +167,7 @@ namespace storm {
STORM_LOG_THROW(!checkName || isValidVariableName(name), storm::exceptions::InvalidArgumentException, "Invalid variable name '" << name << "'."); STORM_LOG_THROW(!checkName || isValidVariableName(name), storm::exceptions::InvalidArgumentException, "Invalid variable name '" << name << "'.");
auto nameIndexPair = nameToIndexMapping.find(name); auto nameIndexPair = nameToIndexMapping.find(name);
if (nameIndexPair != nameToIndexMapping.end()) { if (nameIndexPair != nameToIndexMapping.end()) {
STORM_LOG_ASSERT(indexToTypeMapping.at(nameIndexPair->second) == variableType, "Tried to declareOrGet variable '" << name << "' of type '" << variableType << "' but there is a variable with that name and different type '" << indexToTypeMapping.at(nameIndexPair->second)"'.");
return Variable(this->getSharedPointer(), nameIndexPair->second); return Variable(this->getSharedPointer(), nameIndexPair->second);
} else { } else {
uint_fast64_t offset = 0; uint_fast64_t offset = 0;

Loading…
Cancel
Save