What happens: In LtUnlint.defects() (line 83), the loop that re-adds non-suppressed defects to the result uses the guard line != 0 && defect.line() == line. When a lint produces a defect at line 0 (which happens whenever an XMIR element has no @line attribute — e.g. mandatory-package reports at line 0 when the whole +package meta is absent), and the EO program also contains a line-specific +unlint meta for the same lint (e.g. +unlint mandatory-package:5), the following occurs: (1) global is set to true because a +unlint meta exists; (2) line 5 is removed from problematic but line 0 stays; (3) the loop skips line 0 due to line != 0; (4) added remains false; (5) the fallback if (!added.get() && !global) defects.addAll(found) is also skipped because global is true. The defect at line 0 is silently discarded even though it was never targeted by the +unlint meta. The lineno.xsl helper and empty-object.xsl both explicitly handle line 0 (the XSL even adds a context attribute when $line = '0'), confirming that line-0 defects are an intentional, production-occurring case.
What should happen: A defect at line 0 that is not covered by a global +unlint lint-name suppression should always be reported, regardless of whether other line-specific +unlint metas exist for the same lint.
What happens: In
LtUnlint.defects()(line 83), the loop that re-adds non-suppressed defects to the result uses the guardline != 0 && defect.line() == line. When a lint produces a defect at line 0 (which happens whenever an XMIR element has no@lineattribute — e.g.mandatory-packagereports at line 0 when the whole+packagemeta is absent), and the EO program also contains a line-specific+unlintmeta for the same lint (e.g.+unlint mandatory-package:5), the following occurs: (1)globalis set totruebecause a+unlintmeta exists; (2) line 5 is removed fromproblematicbut line 0 stays; (3) the loop skips line 0 due toline != 0; (4)addedremainsfalse; (5) the fallbackif (!added.get() && !global) defects.addAll(found)is also skipped becauseglobalistrue. The defect at line 0 is silently discarded even though it was never targeted by the+unlintmeta. Thelineno.xslhelper andempty-object.xslboth explicitly handle line 0 (the XSL even adds acontextattribute when$line = '0'), confirming that line-0 defects are an intentional, production-occurring case.What should happen: A defect at line 0 that is not covered by a global
+unlint lint-namesuppression should always be reported, regardless of whether other line-specific+unlintmetas exist for the same lint.