}
const Datatype& dt = (*this)[0].getConst<Datatype>();
unsigned n = dt.getNumParameters();
+ Assert(n < getNumChildren());
for(unsigned i = 0; i < n; ++i) {
- if(TypeNode::fromType(dt.getParameter(i)) == (*this)[n + 1]) {
+ if(TypeNode::fromType(dt.getParameter(i)) == (*this)[i + 1]) {
return false;
}
}
if ( lhsType != rhsType ) {
std::stringstream ss;
ss << Expr::setlanguage(language::toOutputLanguage(Options::current()->inputLanguage));
- ss << "Types do not match in equation ";
- ss << "[" << lhsType << "<>" << rhsType << "]";
+ ss << "Types do not match in equation:" << std::endl;
+ ss << "Equation: " << n << std::endl;
+ ss << "Type 1: " << lhsType << std::endl;
+ ss << "Type 2: " << rhsType << std::endl;
throw TypeCheckingExceptionPrivate(n, ss.str());
}