Add enumeration assignment compatibility check for continuous assignments.
(cherry picked from commit 1b3f0dd689)
This commit is contained in:
parent
d521585901
commit
103f1fa4bb
12
elaborate.cc
12
elaborate.cc
|
|
@ -110,6 +110,18 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
|
|||
return;
|
||||
}
|
||||
|
||||
if (lval->enumeration()) {
|
||||
if (! rval_expr->enumeration()) {
|
||||
cerr << get_fileline() << ": error: "
|
||||
"This assignment requires an explicit cast." << endl;
|
||||
des->errors += 1;
|
||||
} else if (! lval->enumeration()->matches(rval_expr->enumeration())) {
|
||||
cerr << get_fileline() << ": error: "
|
||||
"Enumeration type mismatch in assignment." << endl;
|
||||
des->errors += 1;
|
||||
}
|
||||
}
|
||||
|
||||
NetNet*rval = rval_expr->synthesize(des, scope, rval_expr);
|
||||
|
||||
if (rval == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue