diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index f852e5f04..69daaf83c 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -3157,8 +3157,9 @@ private: if (cextp->childDTypep() || cextp->dtypep()) continue; // Already converted AstClassOrPackageRef* const cpackagerefp = VN_CAST(cextp->classOrPkgsp(), ClassOrPackageRef); - if (!cpackagerefp) { - cextp->v3error("Attempting to extend using a non-class "); + if (VL_UNCOVERABLE(!cpackagerefp)) { + // Linking the extend gives an error before this is hit + cextp->v3error("Attempting to extend using non-class"); // LCOV_EXCL_LINE } else { VSymEnt* const foundp = m_curSymp->findIdFallback(cpackagerefp->name()); bool ok = false; diff --git a/test_regress/t/t_dist_warn_coverage.pl b/test_regress/t/t_dist_warn_coverage.pl index 85ce9260f..25a463a25 100755 --- a/test_regress/t/t_dist_warn_coverage.pl +++ b/test_regress/t/t_dist_warn_coverage.pl @@ -44,7 +44,6 @@ foreach my $s ( 'Assignment pattern with no members', 'Assignment pattern with too many elements', 'Attempted parameter setting of non-parameter: Param ', - 'Attempting to extend using a non-class ', 'Can\'t find varpin scope of ', 'Can\'t resolve module reference: \'', 'Cannot mix DPI import, DPI export, class methods, and/or public ',