mirror of
https://github.com/Z3Prover/z3
synced 2025-06-21 21:33:39 +00:00
generate error on duplicated data-type accessors. Issue 85
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
e27b7e3038
commit
a00a9fbdfd
3 changed files with 28 additions and 0 deletions
|
@ -850,6 +850,13 @@ namespace smt2 {
|
|||
for (unsigned i = 0; i < sz; i++) {
|
||||
pdatatype_decl * d = new_dt_decls[i];
|
||||
SASSERT(d != 0);
|
||||
symbol duplicated;
|
||||
if (d->has_duplicate_accessors(duplicated)) {
|
||||
std::string err_msg = "invalid datatype declaration, repeated accessor identifier '";
|
||||
err_msg += duplicated.str();
|
||||
err_msg += "'";
|
||||
throw parser_exception(err_msg, line, pos);
|
||||
}
|
||||
m_ctx.insert(d);
|
||||
if (d->get_num_params() == 0) {
|
||||
// if datatype is not parametric... then force instantiation to register accessor, recognizers and constructors...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue