diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index b294a4a54f..e1aac7722b 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -3298,12 +3298,14 @@ class LinkDotResolveVisitor final : public VNVisitor { } if (nodep->name() == "local::") { - if (!m_randSymp && !m_ds.m_unresolvedClass) { - // m_randSymp is not set in the 1st pass of V3LinkDot - // if randomize is called on a parameterized class - nodep->v3error("Illegal 'local::' outside 'randomize() with'" - " (IEEE 1800-2023 18.7.1)"); - m_ds.m_dotErr = true; + if (!m_randSymp) { + if (!m_ds.m_unresolvedClass) { + // m_randSymp is not set in the 1st pass of V3LinkDot + // if randomize is called on a parameterized class + nodep->v3error("Illegal 'local::' outside 'randomize() with'" + " (IEEE 1800-2023 18.7.1)"); + m_ds.m_dotErr = true; + } return; } }