From 02fc64067f5a0e0d1adb5d778562728cace0bdb5 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Mon, 2 Jul 2018 12:20:10 -0500 Subject: [PATCH] Improve error message. (#2124) --- src/parser/parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser/parser.cpp b/src/parser/parser.cpp index e8e2c2ea3..1f9c3fd2b 100644 --- a/src/parser/parser.cpp +++ b/src/parser/parser.cpp @@ -269,7 +269,8 @@ void Parser::defineVar(const std::string& name, const Expr& val, Debug("parser") << "defineVar( " << name << " := " << val << ")" << std::endl; if (!d_symtab->bind(name, val, levelZero, doOverload)) { std::stringstream ss; - ss << "Failed to bind " << name << " to symbol of type " << val.getType(); + ss << "Cannot bind " << name << " to symbol of type " << val.getType(); + ss << ", maybe the symbol has already been defined?"; parseError(ss.str()); } assert(isDeclared(name)); -- 2.30.2