Fix instability in non-data type internal error

This commit is contained in:
Wilson Snyder 2025-06-24 17:29:44 -04:00
parent 916d473eff
commit f9f70383fa
1 changed files with 3 additions and 1 deletions

View File

@ -2611,8 +2611,10 @@ class LinkDotResolveVisitor final : public VNVisitor {
if (oldp->wouldBreak(newp)) {
newp->v3error(
"Data type used where a non-data type is expected: " << newp->prettyNameQ());
oldp->replaceWith(new AstConst{newp->fileline(), AstConst::BitFalse{}});
} else {
oldp->replaceWith(newp);
}
oldp->replaceWith(newp);
}
// Marks the current module to be revisited after the initial AST iteration