There is a case in EmitDiagnostics where the filter check is bypassed (when locationStack is empty). Filter might also be bypassed when loc instead of showableLoc is added to the locationStack.
Ah, thanks for fixing this.
This was somewhat intentional. Having this check here would mean that the diagnostic is never shown to the user, potentially leaving them with a silent failure. We need to use some kind of location for the diagnostic, which would either be one of the hidden locations (the current behavior) or UnknownLoc.
Removed modifications for case where error is attached to a filtered location
While filtering is skipped in the case where the error is attached to a filtered location, that is intentional so there is a location for the error