Add check for let misused in statement context (#5733).

This commit is contained in:
Wilson Snyder
2025-02-26 09:08:41 -05:00
parent 3b98db17cc
commit 7f94fa1da7
6 changed files with 44 additions and 1 deletions
+3
View File
@@ -189,6 +189,9 @@ class LinkResolveVisitor final : public VNVisitor {
return;
}
letp->user2(true);
if (VN_IS(nodep->backp(), StmtExpr)) {
nodep->v3error("Expected statement, not let substitution " << letp->prettyNameQ());
}
// letp->dumpTree("-let-let ");
// nodep->dumpTree("-let-ref ");
AstStmtExpr* const letStmtp = VN_AS(letp->stmtsp(), StmtExpr);