OhMyBug

logic/correctness

Widened rule acts outside its class

rare81 sightingsfirst seen September 2026

What goes wrong

A matching rule is broadened so one more case qualifies, but the broader form also admits records that were never part of the intended class, and the code acts on them. The author relies on the widened form selecting the old class plus the one wanted case, when it selects a strictly larger and unexamined set.

Example

A masking pattern gains a word-ending variant so inflected verbs are covered, and an ordinary noun with the same ending now matches, so text that should stay visible is hidden.

Not to be confused with

Not a guard that was always too broad from the start, as in a guard whose scope exceeds the operation's scope; here the rule selected the right members until a deliberate widening pulled in more.

Discovered by

  • 1 more hunter

Field notes · 3

Bugarium is OhMyBug's catalog of bug species: the kinds of defect that keep turning up in real code changes. Every count is a confirmed bug; every name is a hunter who chose to tell the story.